Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 893934

Summary: Openstack Installer: packstack should verify it is running on RHEL 6.4 and above
Product: Red Hat OpenStack Reporter: Nir Magnezi <nmagnezi>
Component: openstack-packstackAssignee: Flavio Percoco <fpercoco>
Status: CLOSED ERRATA QA Contact: Nir Magnezi <nmagnezi>
Severity: medium Docs Contact:
Priority: high    
Version: 2.0 (Folsom)CC: aortega, derekh, fpercoco, jhenner, mmagr, ykaul
Target Milestone: snapshot2Keywords: Triaged
Target Release: 2.1   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-packstack-2012.2.2-0.8.dev346.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 18:24:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
checks it is running on RHEL64
apevec: review-
checks it is running on RHEL6.[4-9] none

Description Nir Magnezi 2013-01-10 10:09:32 UTC
Description of problem:
=======================
packstack should verify it is running on RHEL 6.4
At the moment, There is no prevention from running it on other RHEL versions.

Version-Release number of selected component (if applicable):
=============================================================
Folsom.
packstack version: openstack-packstack-2012.2.2-0.1.dev268.el6.noarch

How reproducible:
=================
100%

Steps to Reproduce:
===================
1. Run packstack on a non RHEL 6.4 server (for example, RHEL 6.3)
2.
3.
 
Actual results:
===============
packstack installs openstack.

Expected results:
=================
packstack should print an error related to the OS version.

Comment 2 Flavio Percoco 2013-01-24 19:43:05 UTC
Created attachment 686938 [details]
checks it is running on RHEL64

Comment 3 Alan Pevec 2013-01-28 18:11:23 UTC
Comment on attachment 686938 [details]
checks it is running on RHEL64

Please modify to work on rhel >= 6.4

Comment 4 Flavio Percoco 2013-01-29 11:10:26 UTC
Created attachment 689744 [details]
checks it is running on RHEL6.[4-9]

Comment 6 Nir Magnezi 2013-01-30 15:33:55 UTC
Verified: openstack-packstack-2012.2.2-0.8.dev346.el6ost.noarch

packstack fail to run on RHEL 6.3 (as expectd).



 Host 10.20.30.40: RHEL version not supported. RHEL >6.4 required
DEBUG:root:Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/packstack/installer/setup_sequences.py", line 60, in run
    function()
  File "/usr/lib/python2.6/site-packages/packstack/plugins/prescript_000.py", line 131, in check_rhel
    sys.exit(1)
SystemExit: 1

                                  [ ERROR ]
DEBUG:root:*** The following params were used as user input:

Comment 7 Yaniv Kaul 2013-01-30 16:32:00 UTC
(In reply to comment #6)
> Verified: openstack-packstack-2012.2.2-0.8.dev346.el6ost.noarch
> 
> packstack fail to run on RHEL 6.3 (as expectd).
> 
> 
> 
>  Host 10.20.30.40: RHEL version not supported. RHEL >6.4 required
> DEBUG:root:Traceback (most recent call last):
>   File
> "/usr/lib/python2.6/site-packages/packstack/installer/setup_sequences.py",
> line 60, in run
>     function()
>   File
> "/usr/lib/python2.6/site-packages/packstack/plugins/prescript_000.py", line
> 131, in check_rhel
>     sys.exit(1)
> SystemExit: 1
> 
>                                   [ ERROR ]
> DEBUG:root:*** The following params were used as user input:


But why with a traceback?

Comment 8 Flavio Percoco 2013-01-31 09:50:36 UTC
There's a patch upstream that takes care of the tracebacks and prints just messages (traceback is logged in the log file). The patch hasn't been merged yet but once it gets in this patch can also be updated to use InstallError.

Patch: https://review.openstack.org/#/c/20816/

Comment 9 Jaroslav Henner 2013-02-07 12:42:37 UTC
Putting back to assigned, because there are problems with this check.

out: Welcome to Installer setup utility

out: Installing:
out: Clean Up...                                              [ DONE ]
out: OS support check... Host 10.x.y.z:: RHEL version not supported. RHEL >6.4 required
out:                                   [ ERROR ]


1) The server is RHEL 6.4. The message is misleading because there was some other problem. The bare except in [1] is no good. 
2) The message is also misleading because it needs RHEL >= 6.4, not REHL > 6.4

BTW: I recommend you to use Paramiko for remote connections. It is much more flexible.


[1] https://bugzilla.redhat.com/attachment.cgi?id=689744&action=diff

Comment 10 Jaroslav Henner 2013-02-07 13:21:39 UTC
I was investigating why this error happens. I found that it was trying to execute these commands:

['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', 'root.33.1', 'bash -x']
['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', 'root.33.2', 'bash -x']
['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', 'root.33.2:', 'bash -x']

"11.22.33.2:" Is not valid IP address, so that's why it raised the ScriptRuntimeError. So catching with any of
 * bare except
 * except Exception
 * except SciptRuntimeError
wouldn't help. 

I think the code should rise some SSHConnectionError in case of connection error. In case of non-zero command result, it should rise ScriptRuntimeError or something like that. But this is AFAIK not possible when using OpenSSH.

Workaround would be to just `cat` the redhat-release file and match it with regexp on the local side using Python.


BTW, the colon character is there because of my buggy answ file:
CONFIG_SWIFT_STORAGE_HOSTS=11.22.33.2:/dev/sda2, 11.22.33.3:/dev/sda2

Comment 11 Martin Magr 2013-02-07 13:52:27 UTC
1. Well packstack tries to ssh only to hosts you have in answer file. So you should give valid IP addresses to packstack :).

2. The version check is performed on all host where OS components are going to be installed, so packtack have to connect to them first.

3. I agree about raising different exception in case of connection error. But this is different issue, so please create another bug for this. I'll set this bug back to verified, so we won't block snapshot2.

Btw thanks for pointing us to paramiko. I didn't know about this package and it looks great from my quick check. Will keep that in mind during refactoring in future.

Comment 12 Alan Pevec 2013-02-10 21:37:07 UTC
(In reply to comment #10)
> ['ssh', '-o', 'StrictHostKeyChecking=no', '-o',
> 'UserKnownHostsFile=/dev/null', 'root.33.1', 'bash -x']

BTW, while at it, this does not use key specified by CONFIG_SSH_KEY unless your specified key happens to be default ~/.ssh/id_rsa
Granted, CONFIG_SSH_KEY is documented as "Path to a Public key" so it won't be usable for ssh -i but packstack cloud at least try to locate corresponding identity file by stripping .pub and use it in ScriptRunner ?

Comment 14 errata-xmlrpc 2013-02-14 18:24:49 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-2013-0260.html