Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1509665 - installing older version images (yum localinstall) create wrong latest links in rhosp-director-images [openstack-12]
Summary: installing older version images (yum localinstall) create wrong latest links ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director-images
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ga
: 12.0 (Pike)
Assignee: Mike Burns
QA Contact: Raviv Bar-Tal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-05 14:18 UTC by Raviv Bar-Tal
Modified: 2017-12-13 20:03 UTC (History)
8 users (show)

Fixed In Version: rhosp-director-images-12.0-20171116.2.el7ost
Doc Type: Bug Fix
Doc Text:
Prior to this update, a logic error in the %post scriptlet resulted in the installation of images from an older major release; this arose after a later release incorrectly set the version-specific symlink. With this update, the script was updated to correctly handle versions, and the symlinks are created correctly.
Clone Of:
: 1514544 1514545 1514546 1514547 (view as bug list)
Environment:
Last Closed: 2017-12-13 20:03:43 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:3459 normal SHIPPED_LIVE Red Hat OpenStack Platform 12.0 director images Enhancement Advisory 2017-12-14 01:03:02 UTC

Description Raviv Bar-Tal 2017-11-05 14:18:13 UTC
Description of problem:
When installing older images form url, the latest link points to the already installed images (example ls -l console output):
[stack@undercloud-0 osp_images]$ ls -l /usr/share/rhosp-director-images/*latest*
lrwxrwxrwx. 1 root root 79 Nov  5 09:00 /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171102.3.el7ost.tar
lrwxrwxrwx. 1 root root 79 Nov  5 08:50 /usr/share/rhosp-director-images/ironic-python-agent-latest-12.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171102.3.el7ost.tar
lrwxrwxrwx. 1 root root 74 Nov  5 09:00 /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar -> /usr/share/rhosp-director-images/overcloud-full-12.0-20171102.3.el7ost.tar
lrwxrwxrwx. 1 root root 74 Nov  5 08:50 /usr/share/rhosp-director-images/overcloud-full-latest-12.0.tar -> /usr/share/rhosp-director-images/overcloud-full-12.0-20171102.3.el7ost.tar


Version-Release number of selected component (if applicable):


How reproducible:
After having image package install on your system,
try to install images form different version 

Steps to Reproduce:
1.
2.
3.

Actual results:
All *latest* links points to the newer version images

Expected results:
Each *latet* link points to it's own version 

Additional info:
This operation it needing in the "mixed version" scenarios where undercloud is N versions ahead of overcloud

Comment 1 Mike Burns 2017-11-07 12:15:11 UTC
This is exactly how it's supposed to work.  -latest is always supposed to point to the "newest" version on the system.  If an older version is desired, you must point to the version specific image file rather that the -latest symlink.

Comment 2 Raviv Bar-Tal 2017-11-08 13:29:08 UTC
I disagree, the latest link also include the version number,
In the case above the symlink:
 /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar
* Latest 10 release image
Points to:
 /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171102.3.el7ost.tar
** latest 12 release image 

I would agree in case the *latest* symlink did not include version number

Raviv

Comment 3 Mike Burns 2017-11-17 17:34:33 UTC
Reopening to investigate

Comment 4 Mike Burns 2017-11-17 18:13:48 UTC
Installing OSP 12 images, then OSP 10 images produces this:  

overcloud-full-latest-10.0.tar -> /usr/share/rhosp-director-images/overcloud-full-12.0-20171116.1.el7ost.tar
ironic-python-agent-latest-10.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-12.0-20171116.1.el7ost.tar

Installing in the opposite direction, 10 first, then 12:

ironic-python-agent-latest-10.0.tar -> /usr/share/rhosp-director-images/ironic-python-agent-10.0-20171108.1.el7ost.tar
overcloud-full-latest-10.0.tar -> /usr/share/rhosp-director-images/overcloud-full-10.0-20171108.1.el7ost.tar


So it's only the install of an older version that breaks this

Comment 5 Mike Burns 2017-11-17 18:18:30 UTC
I think I've found the culprit.  In the %post script:

ver_major=${version%.*}

ver_major is used to check whether a particular version.txt file is for the same major release as the rpm being installed.  In the spec file, ${version} is not defined, only %{version} is.  In spec, you also cannot do the %.* variable parsing, so the spec needs to add this in the %post script prior to the ver+major= line

version=%{version}

Then things work correctly.

This needs to be done on every OSP version starting with OSP 8.

Comment 6 Mike Burns 2017-11-20 14:23:50 UTC
This is the specfile change:

diff --git a/rhosp-director-images.spec b/rhosp-director-images.spec
index ee5401a..5b37081 100644
--- a/rhosp-director-images.spec
+++ b/rhosp-director-images.spec
@@ -55,6 +55,7 @@ echo %{version},%{release} > %{buildroot}%{app_root}/version-%{version}-%{releas
 %post
 nvr=0
 nv=0
+version=%{version}
 ver_major=${version%.*}
 for ver in %{app_root}/version-*txt; do
     ver=$(basename $(echo $ver |  sed 's/\.txt//'))

Comment 8 Mike Burns 2017-11-20 16:08:17 UTC
Note for testing:

This only shows up when you install images from an older release *after* a newer release.

IOW, without the fix:

Install OSP 12 images, then OSP 10 images --> failure

Install OSP 10 images, then OSP 12 images --> works

Comment 14 Raviv Bar-Tal 2017-12-11 14:47:19 UTC
This bug is actually fixed for osp13 and above.
This means that when trying to install osp12 images on osp13 undercloud,
The symlinks will be correct and each latest-version link will point to the correct image.

Comment 17 errata-xmlrpc 2017-12-13 20:03:43 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/RHEA-2017:3459


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