Bug 1413859

Summary: [RFE] Plain rpm should persist after upgrade
Product: [oVirt] ovirt-node Reporter: Huijuan Zhao <huzhao>
Component: RFEsAssignee: Ryan Barry <rbarry>
Status: CLOSED WONTFIX QA Contact: Huijuan Zhao <huzhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1CC: bugs, cshao, dguo, jiawu, leiwang, qiyuan, rbarry, weiwang, yaniwang, ycui, yzhao
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: rule-engine: planning_ack?
rule-engine: devel_ack?
cshao: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-31 09:37:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Huijuan Zhao 2017-01-17 07:40:20 UTC
Description of problem:
Plain rpm does not persist after upgrade. 'rpm -[Ui] foo.rpm' can not persist packages after upgrade.
Should persist plain rpm('rpm -[Ui] **.rpm') after upgrade.

Version-Release number of selected component (if applicable):
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

How reproducible:
100%

Test steps:
1. Install redhat-virtualization-host-4.1-0.20170112.1
2. Reboot and login RHVH4.1, 
   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 kmod-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.

Comment 1 Sandro Bonazzola 2017-01-26 11:25:53 UTC
Ryan isn't this already done?

Comment 2 Ryan Barry 2017-01-26 18:02:08 UTC
RPMs are persisted in 4.1 through yum plugins (a dnf plugin also exists).

We don't tie into `rpm`, though -- the RPM plugin API doesn't provide a way to get at the "actual" package. Instead, ways to hook various RPM transaction steps are provided.

We can probably do this with a trivial wrapper around `rpm` which saves RPMs to persist if '-i' or '-U' are seen, and removes if '-e', plus the long versions of those flags.

Comment 3 Sandro Bonazzola 2017-01-31 09:37:57 UTC
Closing as wont fix, we provide yum local install and we documented it's the way to persist rpm installation.