Bug 740565 - Make rhev-hypervisor RPM multi-installable like the kernel
Summary: Make rhev-hypervisor RPM multi-installable like the kernel
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rhev-hypervisor6
Version: 6.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Mike Burns
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 743938
TreeView+ depends on / blocked
 
Reported: 2011-09-22 13:26 UTC by Perry Myers
Modified: 2016-04-26 14:16 UTC (History)
13 users (show)

Fixed In Version: rhev-hypervisor-6.2-20110929.0.el6
Doc Type: Bug Fix
Doc Text:
Previously, you could not run side-by-side installations of Red Hat Enterprise Virtualization Hypervisor. Now, you can allow side-by-side installations of the hypervisor by configuring yum to make rhev-hypervisor an install-only package. Edit the yum.conf file and add the installonlypkgs option: [main] ... installonlypkgs=rhev-hypervisor This option also needs to include the default list of install-only packages, which you can find by running the man yum.conf command and looking at the installonlypkgs option.
Clone Of:
: 743938 (view as bug list)
Environment:
Last Closed: 2011-12-06 19:28:26 UTC
Target Upstream Version:


Attachments (Terms of Use)
Patch (2.44 KB, patch)
2011-09-28 00:34 UTC, Mike Burns
no flags Details | Diff
Patch (4.81 KB, patch)
2011-09-28 17:17 UTC, Mike Burns
no flags Details | Diff
Updated patch (4.93 KB, patch)
2011-09-29 14:20 UTC, Mike Burns
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1783 normal SHIPPED_LIVE rhev-hypervisor6 bug fix and enhancement update 2011-12-06 15:10:54 UTC

Description Perry Myers 2011-09-22 13:26:25 UTC
Description of problem:
Right now each install of RHEVH ISO overwrites the previous one.  We should make rhev-hypervisor install slotted so that each ISO is named like:

rhev-hypervisor-NVR.iso

and is placed in /usr/share/rhev-hypervisor

Then /usr/share/rhev-hypervisor/rhev-hypervisor.iso becomes symlink to last installed ISO

This will allow RHEVM to utilize the /usr/share/rhev-hypervisor directory directly as an ISO archive for their ISO uploader funtionality

Comment 1 Alan Pevec 2011-09-22 13:33:05 UTC
(In reply to comment #0)
> rhev-hypervisor-NVR.iso

it will be rhevh-VR.iso
where VR includes compose timestamp e.g. rhevh-6.2-20110921.1
This is already used in compose and needs to be short to fit cdlabel limit.

Comment 3 Mike Burns 2011-09-23 13:01:20 UTC
installing with rhevh-VR.iso is easy as is a symlink called rhev-hypervisor.iso.  The tricky thing is the multiple installs.  AFAICT, this is done in the kernel using the installonlypkgs option.  This list is defaulted in the (yum) code to include various kernel packages.  

The setting can also be set in /etc/yum.conf, but this overrides the setting in the code, so it would require that we set the installonlypkgs entry to the full list of packages in the yum source code and then include rhev-h.  

There may be other ways to do this that I haven't found yet, but I'm not sure that it's possible at this point without either changing yum source code or the yum.conf file neither of which is desirable.

Comment 4 Mike Burns 2011-09-23 13:18:38 UTC
After discussions on IRC, we'll make rhev-hypervisor installable side-by-side, but won't do any yum configuration to allow multiple installs.  Instead, we'll add it to the documentation for how to configure yum to allow multiple side-by-side installs

Comment 6 Mike Burns 2011-09-23 13:27:15 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In order to allow side-by-side installs of rhev-hypervisor, you need to configure yum to make rhev-hypervisor an installonly package.  This is done by editing yum.conf and adding the installonlypkgs option.

[main]
...
installonlypkgs=rhev-hypervisor

This option needs to also include the default list of installonly packages which can be found by running man yum.conf and looking at the installonlypkgs option.

Comment 7 Mike Burns 2011-09-28 00:34:51 UTC
Created attachment 525236 [details]
Patch

Draft 1 of the patch:

Add rhev-hypervisor-tools package which contains rhevh-* scripts
rhev-hypervisor and rhev-hypervisor-tools both have requires >= the other (this allows old rhev-hypervisor to be installed while keeping latest -tools.  

Testing process:

touch a file that matches Source1 (in my case since i was building on Fedora: rhev-hypervisor-6.2-0.17.2.fc16.iso)

build the rpms:
rpmbuild --nodeps --define "_sourcedir $PWD" --define "extra_release .mike$(date +%s)" --define "_specdir $PWD" -ba --clean rhev-hypervisor.spec

Setup repo with the rpms

edited /usr/lib/python2.7/site-packages/yum/config.py to allow rhev-hypervisor to be installed multiple times (search installonly and add it to the list)


install rhev-hypervisor
pulled both rhev-hypervisor and rhev-hypervisor tools

$ ls -l /usr/share/rhev-hypervisor/ 
total 16
-rw-r--r--. 1 root root  0 Sep 27 19:35 rhevh-6.2-0.17.2.fc16.mike1317169841.iso
lrwxrwxrwx. 1 root root 67 Sep 27 20:31 rhevh-latest.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.fc16.mike1317169841.iso
lrwxrwxrwx. 1 root root 67 Sep 27 20:31 rhev-hypervisor.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.fc16.mike1317169841.iso
-rw-r--r--. 1 root root 31 Sep 27 20:30 version-6.2-0.17.2.fc16.mike1317169841.txt
lrwxrwxrwx. 1 root root 69 Sep 27 20:31 version.txt -> /usr/share/rhev-hypervisor/version-6.2-0.17.2.fc16.mike1317169841.txt


build new rpms

yum update rhev-hypervisor (need to clean yum cache first)


$ ls -l /usr/share/rhev-hypervisor/ 
total 20
-rw-r--r--. 1 root root  0 Sep 27 19:35 rhevh-6.2-0.17.2.fc16.mike1317169841.iso
-rw-r--r--. 1 root root  0 Sep 27 19:35 rhevh-6.2-0.17.2.fc16.mike1317169913.iso
lrwxrwxrwx. 1 root root 67 Sep 27 20:32 rhevh-latest.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.fc16.mike1317169913.iso
lrwxrwxrwx. 1 root root 67 Sep 27 20:32 rhev-hypervisor.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.fc16.mike1317169913.iso
-rw-r--r--. 1 root root 31 Sep 27 20:30 version-6.2-0.17.2.fc16.mike1317169841.txt
-rw-r--r--. 1 root root 31 Sep 27 20:31 version-6.2-0.17.2.fc16.mike1317169913.txt
lrwxrwxrwx. 1 root root 69 Sep 27 20:32 version.txt -> /usr/share/rhev-hypervisor/version-6.2-0.17.2.fc16.mike1317169913.txt


known issues:

if you install an old version, it will update links to point to the old version, thus mixing up -latest terminology.

uninstall doesn't cleanup symlinks

Comment 9 Mike Burns 2011-09-28 01:33:33 UTC
This will cleanup sym links when the last version is uninstalled.  Still no handling of installing an old version or uninstalling the most recent version.

--- a/rhev-hypervisor.spec
+++ b/rhev-hypervisor.spec
@@ -83,11 +83,19 @@ ln -snf %{app_root}/%{product_code}-%{version}-%{release}.iso %{app_root}/%{prod
 ln -snf %{app_root}/%{product_code}-%{version}-%{release}.iso %{app_root}/%{name}.iso
 ln -snf %{app_root}/version-%{version}-%{release}.txt %{app_root}/version.txt

+%preun
+if [ $1 = 0 ]; then
+    rm %{app_root}/%{product_code}-latest.iso
+    rm %{app_root}/%{name}.iso
+    rm %{app_root}/version.txt
+fi
+
 %clean
 %{__rm} -rf %{buildroot}

 %files
 %defattr(0644,root,root,0755)
+%{app_root}
 %{app_root}/%{product_code}-%{version}-%{release}.iso
 %{app_root}/version-%{version}-%{release}.txt

Comment 10 Mike Burns 2011-09-28 12:33:16 UTC
Actually, removing the newest version ends up recusively removing all rhev-hypervisor packages due to the rhev-hypervisor/rhev-hypervisor-tools interdependence

I'm thinking that we could change rhev-hypervisor-tools to require rhev-hypervisor being installed, but not a specific version

Comment 11 Mike Burns 2011-09-28 15:35:21 UTC
Ok, I think I've worked out all the various problems, so I'll summarize changes

split into 2 packages -- rhev-hypervisor and rhev-hypervisor-tools

rhev-hypervisor-tools contains the renamed livecd-scripts

Dependency relationship is:

rhev-hypervisor requires -tools >= itself
-tools requires any rhev-hypervisor
rhev-hypervisor conflicts with any rhev-h older than right now (so beta2 and pre-beta2 rpms)

layout of the rhev-hypervisor directory: 

$ ll /usr/share/rhev-hypervisor/
total 32K
drwxr-xr-x.   2 root root 4.0K Sep 28 10:36 ./
drwxr-xr-x. 353 root root  12K Sep 28 10:36 ../
-rw-r--r--.   1 root root    0 Sep 27 20:44 rhevh-6.2-0.17.2.el6.test1317220060.iso
lrwxrwxrwx.   1 root root   66 Sep 28 10:36 rhevh-latest.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.el6.test1317220060.iso
lrwxrwxrwx.   1 root root   66 Sep 28 10:36 rhev-hypervisor.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-0.17.2.el6.test1317220060.iso
-rw-r--r--.   1 root root   30 Sep 28 10:27 version-6.2-0.17.2.el6.test1317220060.txt
lrwxrwxrwx.   1 root root   68 Sep 28 10:36 version.txt -> /usr/share/rhev-hypervisor/version-6.2-0.17.2.el6.test1317220060.txt


I apologize for the ugly version info, but it was necessary for testing purposes.  A real build will have 

rhevh-6.2-20110928.0.el6.iso
version-6.2-20110928.0.el6.txt


-latest will *always* point to latest version, not latest installed.  This includes after installs of old versions and uninstalls of the latest version

uninstall will cleanup everything if it's the last version installed (including the /usr/share/rhev-hypervisor directory if nothing is was placed there manually).

Comment 13 Andrew Cathrow 2011-09-28 15:45:36 UTC
The name should include the version 
eg. rhev-hypervisor-6-latest.iso otherwise we can't have 5 and 6 side by side in the same directory.

Comment 14 Alan Pevec 2011-09-28 15:57:10 UTC
(In reply to comment #13)
> The name should include the version 
> eg. rhev-hypervisor-6-latest.iso otherwise we can't have 5 and 6 side by side
> in the same directory.

It definitely won't work with current rhevh 5.7, please clone to 5.8...

Comment 15 Mike Burns 2011-09-28 17:17:07 UTC
Created attachment 525374 [details]
Patch

Takes into account feedback -- currently it does rhevh-latest-6.2.iso, but that can be changed to latest-6.iso if desired.

Comment 18 Mike Burns 2011-09-29 14:20:45 UTC
Created attachment 525585 [details]
Updated patch

moves rhevh-latest-6.2.iso to rhevh-latest-6
changes Conflicts to be <=5.7

Comment 20 Guohua Ouyang 2011-10-11 09:23:23 UTC
Verified on 6.2-20111010, multiple rhevh iso file can be existed:

# ll /usr/share/rhev-hypervisor/ 
total 382992
-rw-r--r-- 1 root root 131072000 Sep 30 07:12 rhevh-6.2-20110929.0.el6.iso
-rw-r--r-- 1 root root 130023424 Oct  6 23:09 rhevh-6.2-20111006.0.el6.iso
-rw-r--r-- 1 root root 131072000 Oct 10 22:06 rhevh-6.2-20111010.0.el6.iso
lrwxrwxrwx 1 root root        55 Oct 11 17:21 rhevh-latest-6.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-20111010.0.el6.iso
lrwxrwxrwx 1 root root        55 Oct 11 17:21 rhev-hypervisor.iso -> /usr/share/rhev-hypervisor/rhevh-6.2-20111010.0.el6.iso
-rw-r--r-- 1 root root        19 Sep 30 07:21 version-6.2-20110929.0.el6.txt
-rw-r--r-- 1 root root        19 Oct  7 00:49 version-6.2-20111006.0.el6.txt
-rw-r--r-- 1 root root        19 Oct 10 22:21 version-6.2-20111010.0.el6.txt
lrwxrwxrwx 1 root root        57 Oct 11 17:21 version.txt -> /usr/share/rhev-hypervisor/version-6.2-20111010.0.el6.txt

Comment 21 Kate Grainger 2011-10-17 03:59:30 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1,9 @@
-In order to allow side-by-side installs of rhev-hypervisor, you need to configure yum to make rhev-hypervisor an installonly package.  This is done by editing yum.conf and adding the installonlypkgs option.
+Previously, you could not run side-by-side installations of Red Hat Enterprise Virtualization Hypervisor. 
 
+Now, you can allow side-by-side installations of the hypervisor by configuring yum to make rhev-hypervisor an install-only package. Edit the yum.conf file and add the installonlypkgs option:
+
 [main]
 ...
 installonlypkgs=rhev-hypervisor
 
-This option needs to also include the default list of installonly packages which can be found by running man yum.conf and looking at the installonlypkgs option.+This option also needs to include the default list of install-only packages, which you can find by running the man yum.conf command and looking at the installonlypkgs option.

Comment 24 errata-xmlrpc 2011-12-06 19:28:26 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.

http://rhn.redhat.com/errata/RHBA-2011-1783.html


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