Bug 501074 - kickstart creation create url --url with full url including host
kickstart creation create url --url with full url including host
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning (Show other bugs)
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:
Last Closed: 2009-09-10 15:25:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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:


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


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:


which means they never get rendered to: 

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) {
                if (!defaultLocation.startsWith("/")) {

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
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.

# 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
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

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

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.


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