Bug 501074 - kickstart creation create url --url with full url including host
kickstart creation create url --url with full url including host
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning (Show other bugs)
530
All Linux
high Severity high
: ---
: ---
Assigned To: Justin Sherrill
Steve Salevan
:
Depends On:
Blocks: 457075
  Show dependency treegraph
 
Reported: 2009-05-15 15:56 EDT by Justin Sherrill
Modified: 2009-09-10 15:25 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 15:25:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Justin Sherrill 2009-05-15 15:56:30 EDT
When rending a kickstart file if the url for the distro is set as a full URL:

http://hostname/path/to/distro

we leave it alone and don't try to change it to work through a proxy.  If it's set to just a path:

/path/to/distro

then when rendered, we render the correct hostname.




Somewhere along the way this was broken and we're generating whole URLS in KickstartableTree.getDefaultDownloadLoacation() so they end up like this:

htt://hostname/path/to/distro


which means they never get rendered to: 
htt://@@http_server@@/path/to/distro

and so cobbler never substitues in the proxy server if one is used.
Comment 1 Justin Sherrill 2009-05-15 15:58:41 EDT
In fact here's a nice piece of code:
                
                StringBuilder buf = new StringBuilder();
                if (host != null && host.length() > 0) {
                    buf.append("http://").append(host);
                }
                if (!defaultLocation.startsWith("/")) {
                    buf.append("/");
                }



so make a string with 'http://hostname'

and if it doesn't start with '/' (which it never will), then append '/'.

How does that make any sense....
Comment 2 Justin Sherrill 2009-05-15 16:10:15 EDT
In summary,

unless we fix this, provisioning through proxy won't work properly if the client can't communicate with the satellite as well..
Comment 3 Justin Sherrill 2009-05-15 17:58:27 EDT
df5eb48
Comment 5 Steve Salevan 2009-06-18 16:22:58 EDT
VERIFIED on 6/12 build of both Satellite and Proxy.
Comment 6 Steve Salevan 2009-07-29 17:51:49 EDT
Test Plan (for clarification purposes):
1. Create a kickstart profile on an RHN Satellite >= 530
2. Activate an RHN Proxy against this Satellite
3. Register a machine to this Proxy
4. Kickstart this machine (registered through the proxy) with the profile you created earlier (on the Satellite)
5. Before the machine reboots, kill the reboot process with a 'shutdown -c'
6. View the URL for the kickstart file supplied for this kickstart in /etc/grub.conf or /etc/lilo.conf (it should be in the ks=<url> kernel parameter)
7. Verify that the kickstart file contains a 'url --url' directive that reflects the FQDN of the Proxy and NOT of the Satellite
8. If this is true, then reboot the box and verify that the kickstart succeeds
Comment 7 John Sefler 2009-08-13 15:10:42 EDT
Re-verified in staged (Satellite-5.3.0-RHEL5-re20090724.0)
Followed the steps in comment #6
The sat was: http://sun-x4200-01.rhts.bos.redhat.com
The proxy was: http://fjs-0-20.rhndev.redhat.com
Notice that /etc/grub.conf and /root/cobbler.ks reference the proxy and not the sat.
moving to RELEASE_PENDING



THE GRUB FILE
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
serial --unit=0 --speed=38400
terminal --timeout=5 serial console
title kick1250186477
        root (hd0,0)
        kernel /vmlinuz ro root=/dev/VolGroup00/LogVol00 acpi=noirq console=ttyS0,38400n8 acpi=noirq ks=http://fjs-0-20.rhndev.redhat.com/cblr/svc/op/ks/system/rlx-3-24:3 ksdevice=link kssendmac lang= text
        initrd /initrd.img
title Red Hat Enterprise Linux Server (2.6.18-128.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-128.el5 com1=38400n8 acpi=noirq
        module /vmlinuz-2.6.18-128.el5xen ro root=/dev/VolGroup00/LogVol00 acpi=noirq console=ttyS0,38400n8 acpi=noirq
        module /initrd-2.6.18-128.el5xen.img



THE KICKSTART FILE
# Kickstart config file generated by RHN Satellite Config Management
# Profile Label : ks_to_RHEL5
# Date Created  : 2009-08-13 13:57:03.0

install
text
network --bootproto dhcp
url --url http://fjs-0-20.rhndev.redhat.com/ty/PYFuP7mY
lang en_US
keyboard us
<cut off>
Comment 8 Brandon Perkins 2009-09-10 15:25:53 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

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