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 1514544 - installing older version images (yum localinstall) create wrong latest links in rhosp-director-images [openstack-11]
Summary: installing older version images (yum localinstall) create wrong latest links ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director-images
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 11.0 (Ocata)
Assignee: Mike Burns
QA Contact: Omri Hochman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-17 18:22 UTC by Mike Burns
Modified: 2018-06-22 12:35 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1509665
Environment:
Last Closed: 2018-06-22 12:35:03 UTC


Attachments (Terms of Use)

Description Mike Burns 2017-11-17 18:22:50 UTC
+++ This bug was initially created as a clone of Bug #1509665 +++

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

--- Additional comment from Mike Burns on 2017-11-07 07:15:11 EST ---

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.

--- Additional comment from Raviv Bar-Tal on 2017-11-08 08:29:08 EST ---

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

--- Additional comment from Mike Burns on 2017-11-17 12:34:33 EST ---

Reopening to investigate

--- Additional comment from Mike Burns on 2017-11-17 13:13:48 EST ---

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

--- Additional comment from Mike Burns on 2017-11-17 13:18:30 EST ---

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 1 Mike Burns 2017-11-20 14:23:54 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 2 Mike Burns 2017-11-20 16:08:21 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 3 Scott Lewis 2018-06-22 12:35:03 UTC
OSP11 is now retired, see details at https://access.redhat.com/errata/product/191/ver=11/rhel---7/x86_64/RHBA-2018:1828


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