Bug 1361230 - [RFE] Simple mechanism to apply rpms after upgrades
Summary: [RFE] Simple mechanism to apply rpms after upgrades
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-node
Classification: oVirt
Component: RFEs
Version: 4.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ovirt-4.1.0-beta
: 4.1
Assignee: Ryan Barry
QA Contact: Huijuan Zhao
URL: https://trello.com/c/72zIg5eG/12-upda...
Whiteboard:
Depends On:
Blocks: 1420185
TreeView+ depends on / blocked
 
Reported: 2016-07-28 14:45 UTC by Fabian Deutsch
Modified: 2017-02-08 21:11 UTC (History)
13 users (show)

Fixed In Version: imgbased-0.9.4-0.1.el7ev
Doc Type: Enhancement
Doc Text:
Red Hat Virtualization Host (RHVH) 4.0 allows users to install RPMs, however installed RPMs are lost after upgrading RHVH. RHVH 4.1 now includes a yum plugin which saves and reinstalls RPM packages after upgrading, to ensure that installed RPMs are no longer lost after upgrading. This will not work when upgrading from RHVH 4.0 to RHVH 4.1.
Clone Of:
Environment:
Last Closed: 2017-02-01 14:57:44 UTC
oVirt Team: Node
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: blocker+
bmcclain: priority_rfe_tracking+
cshao: testing_plan_complete+
mgoldboi: planning_ack+
fdeutsch: devel_ack+
ycui: testing_ack+


Attachments (Terms of Use)
Comment 8 : sosreport and all logs in /var/log and /tmp (8.87 MB, application/x-gzip)
2017-01-06 03:21 UTC, Huijuan Zhao
no flags Details
Comment 20: All logs in /var/log, /tmp and sosreport (9.20 MB, application/x-gzip)
2017-01-17 05:59 UTC, Huijuan Zhao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 64935 0 master MERGED yum plugin for RPM persistence 2020-02-27 02:29:30 UTC
oVirt gerrit 64939 0 master MERGED dnf plugin for RPM persistence 2020-02-27 02:29:30 UTC
oVirt gerrit 65081 0 master MERGED Add an imgbased plugin to reinstall persisted RPMs 2020-02-27 02:29:29 UTC
oVirt gerrit 68835 0 ovirt-4.1 MERGED yum plugin for RPM persistence 2020-02-27 02:29:29 UTC
oVirt gerrit 68836 0 ovirt-4.1 MERGED dnf plugin for RPM persistence 2020-02-27 02:29:29 UTC
oVirt gerrit 68838 0 ovirt-4.1 MERGED Add an imgbased plugin to reinstall persisted RPMs 2020-02-27 02:29:29 UTC
oVirt gerrit 70126 0 master MERGED RPM persistence -- keep depinstalled+depupdated 2020-02-27 02:29:29 UTC
oVirt gerrit 70169 0 ovirt-4.1 MERGED RPM persistence -- keep depinstalled+depupdated 2020-02-27 02:29:29 UTC

Description Fabian Deutsch 2016-07-28 14:45:20 UTC
Description of problem:
Currently rpms can be installed on Node, however, those rpms are not kept between updates.

This RFE is about a simple mechanism to "keep" between or re-apply rpms after updates.

One implementation could be to look for volumes with a specific label and try to install all rpms on this volume.
The label of the volume can be similar to what is used for driver disks v3 as described here:

https://github.com/rhinstaller/anaconda/blob/master/docs/driverdisc.rst

Comment 1 Red Hat Bugzilla Rules Engine 2016-07-28 14:45:24 UTC
This request has been proposed for two releases. This is invalid flag usage. The ovirt-future release flag has been cleared. If you wish to change the release flag, you must clear one release flag and then set the other release flag to ?.

Comment 2 Itamar Heim 2016-07-31 12:03:02 UTC
iirc, we discussed a generalization of this. don't treat rpm's as a special feature, rather allow to have a scripts folder which would run post boot, and if one wants they'll just write "yum install -y ..." in those scripts?
you could have a folder for scripts to run once post new image, or to run post every boot.
(for those running only once, may get tricky if they fail, so i'd just do "every boot", and the script could take care of flagging if it already ran post last new image[1].
in short, keep it simple...


[1] a script can place the status on a folder which will go away with the new image to lose the state on new image.

Comment 3 Yaniv Kaul 2016-08-17 11:41:33 UTC
I would actually take the RPMs from cache and reinstall them.

Comment 6 Red Hat Bugzilla Rules Engine 2016-09-22 10:18:20 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 7 Red Hat Bugzilla Rules Engine 2016-09-22 10:19:24 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 9 Huijuan Zhao 2017-01-06 03:21:21 UTC
Created attachment 1237852 [details]
Comment 8 : sosreport and all logs in /var/log and /tmp

Comment 10 Ryan Barry 2017-01-06 03:28:54 UTC
Note that this will only work on systems which are 4.1+

Installing a 4.1 image and upgrading to a later image will persist the RPMs. We rely on a yum plugin in order to save these off to a lookaside directory, then imgbased has a plugin which checks that lookaside and installs the RPMs on upgrades (rather than pure imgbased code, which is called as part of the upgrade process).

It's theoretically possible to backport this yum plugin to 4.0.z builds without the imgbased component given an appropriate Z-stream bug, but this feature will only work on 4.1 and above.

I can deliver a second RHV-H build tomorrow in order to verify this by installing a 4.1 image and upgrading to another 4.1 image.

Comment 11 Huijuan Zhao 2017-01-06 06:06:36 UTC
Thanks Ryan, so I will test it after another 4.1 image is ready.

Comment 12 Ying Cui 2017-01-09 11:26:31 UTC
Ryan, this RFE verification is blocked by no second 4.1 build to test 4.1 upgrade. Could you please provide the build to QE soon?

Comment 13 Ryan Barry 2017-01-09 13:35:20 UTC
There will be a new build by end of day tomorrow.

Comment 14 jianwu 2017-01-12 08:26:51 UTC
Hi, Ryan

I have re-tried to verify this bug on the following version:
 - redhat-virtualization-host-4.1-20170104.0 (old build)
 - redhat-virtualization-host-4.1-20170111.0 (new buuld)

Strictly follow the # Commnet 8, but without register to RHEVM.

Step to reproduce:
1. Install redhat-virtualization-host-4.1-20170104.0 build
2. Reboot and login RHVH4.1, install two RPMs:
   Install kmod-oracleasm-2.0.8-17.el7.x86_64.rpm and check it after installation:
   # rpm -ivh kmod-oracleasm-2.0.8-17.el7.x86_64.rpm
   # ls /usr/lib/modules/3.10.0-514.el7.x86_64/weak-updates/
   Setup repos for httpd and install it, check it after installation. And remove repos after installation.
   # yum install httpd
   # rpm -qa | grep httpd

3. Download redhat-virtualization-host-image-update 4.1-20170111.0.el7_3.noarch.rpm and Upgrade RHVH:
   # yum install redhat-virtualization-host-image-update-4.1-20170111.0.el7_3.noarch.rpm
4. Reboot and login new build RHVH4.1, check oracleasm and httpd:
   # ls /usr/lib/modules/3.10.0-514.el7.x86_64/weak-updates/
   # rpm -qa | grep httpd

Actual results:
Before update:
# ls /usr/lib/modules/3.10.0-514.el7.x86_64/weak-updates/
oracleasm
# rpm -qa|grep httpd
httpd-tools-2.4.6-45.el7.x86_64
httpd-2.4.6-45.el7.x86_64

After update:
# ls /usr/lib/modules/3.10.0-514.el7.x86_64/weak-updates/
# rpm -qa|grep httpd
Output no results

Additional info:
If rollback to old build, it could find two installed packages before upgrade

So this bug is not fixed in new build(redhat-virtualization-host-4.1-20170111.0)
I will change status to ASSIGNEN.

Comment 16 Ryan Barry 2017-01-12 14:31:40 UTC
Looks like ts.depinstalled and ts.depupdated were missed in the yum plugin (probably because I tested by installing something with no deps).

Additionally, we don't have an rpm plugin, so 'rpm -[Ui] foo.rpm' will not persist packages. This is a thought for a future feature, but the RPM plugin documentation is very lacking.

Comment 18 cshao 2017-01-13 03:17:07 UTC
Hi Jiawu,

Could you please help to verify this bug?

Thanks.

Comment 20 Huijuan Zhao 2017-01-17 05:57:23 UTC
This bug is not fixed completely in redhat-virtualization-host-4.1-0.20170116.0, some RPMs(such as kmod-oracleasm) still can not be persisted after upgrade.

Test version:
1. Before upgrade:
redhat-virtualization-host-4.1-0.20170112.1
imgbased-0.9.4-0.1.el7ev.noarch
kernel-3.10.0-514.2.2.el7.x86_64
redhat-virtualization-host-image-update-placeholder-4.1-0.5.el7.noarch
2. After upgrade:
redhat-virtualization-host-4.1-0.20170116.0
imgbased-0.9.4-0.1.el7ev.noarch
kernel-3.10.0-514.2.2.el7.x86_64
redhat-virtualization-host-image-update-4.1-20170116.0.el7_3.noarch


Test steps:
1. Install redhat-virtualization-host-4.1-0.20170112.1
2. Reboot and login RHVH4.1, install RPM kmod-oracleasm:
   Download kmod-oracleasm-2.0.8-17.el7.x86_64.rpm.
   Install kmod-oracleasm-2.0.8-17.el7.x86_64.rpm and check it after installation:
   # rpm -ivh kmod-oracleasm-2.0.8-17.el7.x86_64.rpm
   # ls /usr/lib/modules/3.10.0-514.2.2.el7.x86_64/weak-updates/
3. Setup local repo in RHVH4.1 and upgrade to redhat-virtualization-host-4.1-0.20170116.0:
   # yum update
4. Reboot and login new build RHVH-4.1-0.20170116.0, check oracleasm:
   # ls /usr/lib/modules/3.10.0-514.2.2.el7.x86_64/weak-updates/


Actual results:
1. In step2, install RPM successful:
   # ls /usr/lib/modules/3.10.0-514.2.2.el7.x86_64/weak-updates/
   oracleasm
2. In step4, the RPM installed in step2 are disappeared.
   # ls /usr/lib/modules/3.10.0-514.2.2.el7.x86_64/weak-updates/

Expected results:
2. In step4, the RPM kmod-oracleasm installed in step2 should be persisted, the check results should be same as step2.


Additional info:
RPM httpd(setup repos and install via yum) can be persisted after upgrade

So I will assign this bug, and I will open a new bug to trace this issue and block this RFE bug verification.

Comment 21 Huijuan Zhao 2017-01-17 05:59:12 UTC
Created attachment 1241556 [details]
Comment 20: All logs in /var/log, /tmp and sosreport

Comment 22 Ryan Barry 2017-01-17 06:06:55 UTC
Please see comment#16. Plain rpm does not persist. yum localinstall (or dnf localinstall) must be used.

Writing a plugin for regular RPM is on the to-do list, but it is not this feature.

If kmod-oracleasm is installed with yum localinstall, it will persist. RPMs are saved to /var/imgbased/persisted-rpms for reinstallation after upgrading.

Comment 23 Huijuan Zhao 2017-01-17 07:08:50 UTC
(In reply to Ryan Barry from comment #22)
> Please see comment#16. Plain rpm does not persist. yum localinstall (or dnf
> localinstall) must be used.
> 
> Writing a plugin for regular RPM is on the to-do list, but it is not this
> feature.
> 
> If kmod-oracleasm is installed with yum localinstall, it will persist. RPMs
> are saved to /var/imgbased/persisted-rpms for reinstallation after upgrading.

Thanks Ryan, I tested kmod-oracleasm which is installed with yum localinstall, it persists after upgrade, so this RFE bug is fixed in imgbased-0.9.4-0.1.el7ev.noarch, I will change the status to VERIFIED.

But for the future feature issue: Plain rpm does not persist after upgrade, I will report a new RFE bug to trace it.

Thanks!


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