Bug 246300 - Installation number and repos missing after upgrade to Satellite 5.0
Installation number and repos missing after upgrade to Satellite 5.0
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades (Show other bugs)
500
All Linux
high Severity high
: ---
: ---
Assigned To: Jan Pazdziora
Steve Salevan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-29 17:37 EDT by Scott Dodson
Modified: 2007-08-29 11:34 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat501
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-29 11:34:30 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 Scott Dodson 2007-06-29 17:37:29 EDT
Description of problem:
key --skip must have been implied under Satellite 4.2. Profiles that existed
under 4.2 lack Installation Number line which causes installation to halt
waiting for user input (skip or enter IN)

Version-Release number of selected component (if applicable):
Satellite 5.0

How reproducible:
100%

Steps to Reproduce:
1. create RHEL5 kickstart profile under Satellite 4.2
2. Upgrade to Satellite 5.0
3. Provision a machine with kickstart profile created in step #1
  
Actual results:
Kickstart stalls waiting for the user to input an Installation Number or skip

Expected results:
Kickstart completes without interaction

Additional info:
Comment 1 Mike McCune 2007-06-29 17:38:48 EDT
moving to 501 maint and Upgrades component.
Comment 3 Clifford Perry 2007-07-12 19:02:28 EDT
https://satellite.gsslab.rdu.redhat.com/rhn/kickstart/KickstartOptionsEdit.do?ksid=707
http://satellite.gsslab.rdu.redhat.com/kickstart/ks/label/inventory


Basically with Satellite 4.2.1 we did the:
repo 
and
key

lines for RHEL 5 kickstarts statically in Java as they are rendered. 

With Satellite 5.0 these were added as options, which show up under advanced
options for kickstart profile. Scott fixed his 'key' issues by editing under
advanced options. 

What we need to do with the schema upgrade script is to pre-populate within the
schema for RHEL 5 kickstart profiles the 'standard' entries that we place :

http://rlx-1-12.rhndev.redhat.com/kickstart/ks/label/cliff-test-rhel5

repo --name=Cluster
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/Cluster
repo --name=ClusterStorage
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/ClusterStorage
repo --name=VT
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/VT
repo --name=Workstation
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/Workstation
key --skip

Think this is rhnKickstartCommand and rhnKickstartCommandName tables are the
ones of interest. 

Comment 4 Jan Pazdziora 2007-07-19 10:32:40 EDT
This is a SQL to add "key --skip" to any RHEL 5 kickstart which doesn't have any
key yet:

insert into rhnkickstartcommand
        ( id, kickstart_id, ks_command_name_id, arguments, created, modified )
select rhn_kscommand_id_seq.nextval,
rhnkickstartdefaults.kickstart_id,key_id.id, '--skip', sysdate, null
from rhnkickstartdefaults, (
        select rhnkickstartcommandname.id
        from rhnkickstartcommandname
        where rhnkickstartcommandname.name = 'key'
        ) key_id, rhnkickstartabletree, rhnksinstalltype
where rhnkickstartdefaults.kstree_id = rhnkickstartabletree.id
        and rhnkickstartabletree.install_type = rhnksinstalltype.id
        and rhnksinstalltype.label = 'rhel_5'
        and not exists (
                select 1
                from rhnkickstartcommand
                where rhnkickstartdefaults.kickstart_id =
rhnkickstartcommand.kickstart_id
                        and rhnkickstartcommand.ks_command_name_id = key_id.id
        )
Comment 5 Jan Pazdziora 2007-07-19 11:55:54 EDT
For the repo command, is it alright to put in

repo --name=Cluster
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/Cluster

even if the base URL will be in the ty form

url --url http://rlx-1-12.rhndev.redhat.com/ty/v49bP9JB

?
Comment 6 Jan Pazdziora 2007-07-19 12:06:07 EDT
(In reply to comment #5)
> For the repo command, is it alright to put in
> 
> repo --name=Cluster
>
--baseurl=http://rlx-1-12.rhndev.redhat.com/kickstart/dist/ks-rhel-i386-server-5/Cluster
> 
> even if the base URL will be in the ty form
> 
> url --url http://rlx-1-12.rhndev.redhat.com/ty/v49bP9JB
> 
> ?

Yes, Jan, this seems exactly what Satellite 5.0.0 is doing when you create a new
RHEL 5 kickstart.
Comment 7 Jan Pazdziora 2007-07-19 12:33:48 EDT
And here's the URL to add that those four missing repo commands:

insert into rhnkickstartcommand
        ( id, kickstart_id, ks_command_name_id, arguments, created, modified )
select rhn_kscommand_id_seq.nextval, rhnkickstartdefaults.kickstart_id, repo_id.id, 
        '--name=' || names.name || ' --baseurl='
                || rtrim(replace(replace(rhnkickstartcommand.arguments, '--url
', ''), 'rhn/kickstart', 'kickstart/dist'), '/')
                || '/' || names.name,
        sysdate, null
from rhnkickstartdefaults, (
        select rhnkickstartcommandname.id
        from rhnkickstartcommandname
        where rhnkickstartcommandname.name = 'repo'
        ) repo_id, rhnkickstartabletree, rhnksinstalltype,
        (
        select rhnkickstartcommandname.id
        from rhnkickstartcommandname
        where rhnkickstartcommandname.name = 'url'
        ) url_id, rhnkickstartcommand,
        (
        select 'Cluster' name from dual
        union all
        select 'ClusterStorage' name from dual
        union all
        select 'Workstation' name from dual
        union all
        select 'VT' name from dual
        ) names
where rhnkickstartdefaults.kstree_id = rhnkickstartabletree.id
        and rhnkickstartabletree.install_type = rhnksinstalltype.id
        and rhnksinstalltype.label = 'rhel_5'
        and not exists (
                select 1
                from rhnkickstartcommand x
                where rhnkickstartdefaults.kickstart_id = x.kickstart_id
                        and x.ks_command_name_id = repo_id.id
        )
        and rhnkickstartdefaults.kickstart_id = rhnkickstartcommand.kickstart_id
        and rhnkickstartcommand.ks_command_name_id = url_id.id
        and rhnkickstartcommand.arguments like '--url http%'
Comment 9 Clifford Perry 2007-07-19 15:26:56 EDT
Hi Jan - for me - option #2 is the most ideal solution. 

We look to have a set of SQL scripts (which you do) which will know for (by
checking) for existing RHEL 5 kickstart profiles and for these profiles, during
the upgrade add in the additional options into the DB which are needed under
advanced options to provide the additional repo and key options still with the
RHEL 5 kickstart profile post upgrade from 4.2 to 5.0 Sat. 

We should also have this script seperate and available to SEG and other to
provide to customers who already have upgraded to 'fix' the missing data. 

Cliff. 

PS - nice to see I'm not the only person to talk to myself over bugzilla :)
Comment 10 Jan Pazdziora 2007-07-20 03:11:39 EDT
A fix to the satellite-4.2-to-5.0.sql script committed to SVN, trunk revision
118458, branch RELEASE-5.0 revision 118459.
Comment 13 Jan Pazdziora 2007-08-02 16:37:07 EDT
Moving ON_QA because:

Satellite 5.0.1-1 and Proxy 5.0.1-1 are now available on webqa hosted
channels.  Satellite 5.0.1-1 ISOs are now available.
Comment 14 Steve Salevan 2007-08-06 16:23:14 EDT
Followed test plan and kickstart w/ 420 KS profile on upgraded 501 Satellite
proceeded without interaction.  Thus, I'm moving this bug to VERIFIED.
Comment 15 Corey Welton 2007-08-27 11:15:38 EDT
RELEASE_PENDING

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