Bug 1320428 - ospd - sat6 registration fails due to wrong detected satellite version
Summary: ospd - sat6 registration fails due to wrong detected satellite version
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ga
: 8.0 (Liberty)
Assignee: James Slagle
QA Contact: Alexander Chuzhoy
URL:
Whiteboard:
Depends On:
Blocks: 1320609
TreeView+ depends on / blocked
 
Reported: 2016-03-23 08:17 UTC by Martin Schuppert
Modified: 2019-10-10 11:39 UTC (History)
5 users (show)

Fixed In Version: openstack-tripleo-heat-templates-0.8.14-1.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1320609 (view as bug list)
Environment:
Last Closed: 2016-04-20 13:04:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 296071 0 None None None 2016-03-23 15:53:03 UTC
OpenStack gerrit 297284 0 None None None 2016-03-28 11:03:52 UTC
Red Hat Product Errata RHBA-2016:0653 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OSP 8 director Bug Fix Advisory 2016-04-20 17:02:07 UTC

Description Martin Schuppert 2016-03-23 08:17:47 UTC
Description of problem:

Deploy an overcloud and register it to sat6 will fail due
to wrong validation of the sat version and tries to register to sat
version 5 instead:

$ openstack overcloud deploy   --templates   --ntp-server
ntp.example.com   --control-flavor control --compute-flavor compute
--ceph-storage-flavor ceph   --control-scale 3 --compute-scale 3
--ceph-storage-scale 5   --neutron-tunnel-types vxlan
--neutron-network-type vxlan   -e
/usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml
  -e ~/templates/bb1-overcloud-storage.yaml   -e
~/templates/bb1-overcloud-network.yaml   -e
~/templates/bb1-overcloud-hostnames.yaml -e
~/templates/firstboot/user-data.yaml -e ~/templates/param-updates.yaml
--rhel-reg --reg-method satellite --reg-org ORG --reg-sat-url
http://satellite.example.com --reg-activation-key RHEL-OSP7-Production

Deploying templates in the directory
/usr/share/openstack-tripleo-heat-templates
Stack failed with status: Resource CREATE failed: Error:
resources.Controller.resources[1].resources.NodeExtraConfig.resources.RHELRegistrationDeployment:
Deployment to server failed: deploy_status_code: Deployment exited with
non-zero status code: 7
ERROR: openstack Heat Stack create failed.

...

Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: +
detect_satellite_version
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: +
ping_api=http://satellite.example.com/katello/api/ping
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + curl -k
-s -D - -o /dev/null http://satellite.example.com/katello/api/ping
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + grep
'200 OK'
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + echo
Satellite 5 detected at http://satellite.example.com
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: +
satellite_version=5
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + '['
satellite_version = 6 ']'
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + pushd
/usr/share/rhn/
Mar 18 06:45:47 ceph4.example.com os-collect-config[8764]: + curl -k
-O http://satellite.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT

determine the version:
~~~
function detect_satellite_version {
    ping_api=$REG_SAT_URL/katello/api/ping
    if curl -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then
        echo Satellite 6 detected at $REG_SAT_URL
        satellite_version=6
    else
        echo Satellite 5 detected at $REG_SAT_URL
        satellite_version=5
    fi
}
~~~

When run the curl manually we see due to redirect to https a "301 Moved
Permanently" instead of "200 OK"

$ curl -k -s -D -
http://satellite.example.com/katello/api/ping
HTTP/1.1 301 Moved Permanently
Date: Tue, 22 Mar 2016 13:40:59 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Apipie-Checksum: 2ff300f5db2e930311aa268997f1202e
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: no-cache
X-Request-Id: 681d91a853baf98420728b9d7014a315
X-Runtime: 0.006964
X-Rack-Cache: miss
X-Powered-By: Phusion Passenger 4.0.18
Location: https://satellite.example.com/katello/api/ping
Status: 301 Moved Permanently
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

<html><body>You are being <a
href="https://satellite.example.com/katello/api/ping">redirected</a>.</body></html>

So probably curl '-L' option is needed.

Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates-0.8.6-121.el7ost.noarch

How reproducible:
always

Steps to Reproduce:
1. deploy overcloud and subscribe to sat 6 

Actual results:
deploy fail

Expected results:
successful deploy and systems get registered to sat 6

Additional info:

Comment 1 James Slagle 2016-03-23 15:53:43 UTC
looks like there are a couple of regressions related to sat 6 registration when I added support for satellite 5.

they should be fixed by https://review.openstack.org/#/c/296071/

Comment 7 Alexander Chuzhoy 2016-04-13 21:37:38 UTC
Verified:

Environment:
openstack-tripleo-heat-templates-0.8.14-7.el7ost.noarch


Successfully deployed overcloud and registered to sat6.


if curl -L -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then echo Satellite 6 detected at http://<FQDN of sat6>/; fi
HTTP/1.1 200 OK
Status: 200 OK
Satellite 6 detected at http://<FQDN of sat6>/

Comment 9 errata-xmlrpc 2016-04-20 13:04:21 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.

https://rhn.redhat.com/errata/RHBA-2016-0653.html


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