Bug 1320609 - 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
unspecified
unspecified
Target Milestone: async
: 7.0 (Kilo)
Assignee: James Slagle
QA Contact: Alexander Chuzhoy
URL:
Whiteboard:
Depends On: 1320428
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-23 15:55 UTC by James Slagle
Modified: 2019-10-10 11:39 UTC (History)
7 users (show)

Fixed In Version: openstack-tripleo-heat-templates-0.8.6-124.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of: 1320428
Environment:
Last Closed: 2016-07-06 15:05:49 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:55:34 UTC
Red Hat Product Errata RHBA-2016:1387 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OSP 7 director Bug Fix Advisory 2016-07-06 19:04:38 UTC

Description James Slagle 2016-03-23 15:55:34 UTC
+++ This bug was initially created as a clone of Bug #1320428 +++

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:

--- Additional comment from James Slagle on 2016-03-23 11:53:43 EDT ---

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 4 Alexander Chuzhoy 2016-05-24 19:48:45 UTC
Verified:
Environment:
openstack-tripleo-heat-templates-0.8.6-124.el7ost.noarch

Was able to deploy kilo and registrate the OC nodes to SAT6.


Deployment command:
openstack overcloud deploy --templates --control-scale 3 --compute-scale 1 --ceph-storage-scale 1   --neutron-network-type vxlan --neutron-tunnel-types vxlan  --ntp-server x.x.x.x --timeout 90 -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e network-environment.yaml  --rhel-reg --reg-method satellite --reg-sat-url <URL> --reg-activation-key <key> --reg-org <org>

Running detect_satellite_version from comment 0:

HTTP/1.1 200 OK
Status: 200 OK
Satellite 6 detected at <URL>

Comment 7 errata-xmlrpc 2016-07-06 15:05: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.

https://access.redhat.com/errata/RHBA-2016:1387


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