Bug 995526

Summary: regression: --cost ignored in kickstart file
Product: [Fedora] Fedora Reporter: Ian Collier <imc>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: anaconda-maint-list, dshea, g.kaviyarasu, imc, jonathan, mkolman, sbueno, stephent98, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-21 19:33:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
ks-bz995526.cfg F19 kickstart file with two updates repos weighted by cost
none
anaconda-ks.cfg without "repo" options from installed F19 system
none
ks-bz995526-f18.cfg F18 kickstart file with two updates repos weighted by cost
none
anaconda-ks-f18.cfg with "repo" options from installed F18 system
none
anaconda-tb-6OLaPX captured while paused at the Reboot button none

Description Ian Collier 2013-08-09 15:37:14 UTC
Description of problem:

A kickstart file contains the following lines:

nfs --server=csfs --dir=/cs/software/fedora/fedora19
repo --name="Fedora_19.mirror" --baseurl=http://mirror.ox.ac.uk/sites/download.fedora.redhat.com/pub/fedora/linux/releases/19/Everything/x86_64/os --cost=10000

This should allow the installer to go out to the web site if we ask for a package that's not present in the installation repo, but everything else should be installed from NFS.  However, after the install, every package is shown as having been installed from the web mirror.  This same scheme did work properly in Fedora 17.

During the install, anaconda wrote out a file called /tmp/yum.repos.d/Fedora_19.mirror.repo with the following contents:

[Fedora_19.mirror]
name=Install - Fedora_19.mirror
enabled=1
baseurl=http://mirror.ox.ac.uk/sites/download.fedora.redhat.com/pub/fedora/linux/releases/19/Everything/x86_64/os/

Note that the "cost=" line is absent.  There is definitely code in anaconda to write that line - I'm not sure where it gets stripped.

Possibly related: bug 994940

Comment 1 Steve Tyler 2013-08-09 17:39:43 UTC
Thanks for your report.

The F19 Installation Guide does not show a "--cost" suboption for the "repo" option:

15.4. Kickstart Options
http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/s1-kickstart2-options.html

However, the yum.conf man page shows "cost" as a repository option:

$ man yum.conf | less -N
...
    500 [repository] OPTIONS
    501        The repository section(s) take the following form:
    502 
    503               Example: [repositoryid]
    504               name=Some name for this repository
    505               baseurl=url://path/to/repository/
...
    650               cost relative cost of accessing this repository. Useful for weighing one repo's packages as greater/less than any other. defaults to 1000
...

$ rpm -qf /usr/share/man/man5/yum.conf.5
yum-3.4.3-105.fc19.noarch

Comment 2 Ian Collier 2013-08-09 21:44:06 UTC
>The F19 Installation Guide does not show a "--cost" suboption for the "repo" option

No, but the Anaconda documentation does:
https://fedoraproject.org/wiki/Anaconda/Kickstart#repo

and the kickstart file passes ksvalidator because both pykickstart and pyanaconda contain code to deal with this option.  It worked in F17

Comment 3 Steve Tyler 2013-08-09 22:08:53 UTC
Thanks for pointing that out. The F19 Installation Guide lists three suboptions:

repo --name=<repoid> [--baseurl=<url>| --mirrorlist=<url>]
http://docs.fedoraproject.org/en-US/Fedora/19/html/Installation_Guide/s1-kickstart2-options.html

The Anaconda/Kickstart wiki lists nine suboptions:
https://fedoraproject.org/wiki/Anaconda/Kickstart#repo

repo --name=<name> [--baseurl=<url>|--mirrorlist=<url>] [options]
--name=
--baseurl=
--mirrorlist=
--cost=
--excludepkgs=
--includepkgs=
--proxy=[protocol://][username[:password]@]host[:port]
--ignoregroups=true
--noverifyssl

So it looks like there needs to be a documentation bug, too ...

Comment 4 Steve Tyler 2013-08-09 22:10:48 UTC
(In reply to Ian Collier from comment #0)
...
> ... This same scheme did
> work properly in Fedora 17.
...

Did you try F18?

Comment 5 Steve Tyler 2013-08-11 20:11:21 UTC
(In reply to Steve Tyler from comment #3)
...
> So it looks like there needs to be a documentation bug, too ...

Bug 995886 - kickstart "repo" suboptions incomplete

Comment 6 Ian Collier 2013-08-11 22:32:47 UTC
> Did you try F18?

Sorry, I skipped 18 (or rather, used FedUp) so have no data on that.

Comment 7 Steve Tyler 2013-08-12 03:21:47 UTC
(In reply to Ian Collier from comment #0)
...
> ... However, after the install, every package is
> shown as having been installed from the web mirror.
...

Could you clarify this ... are you looking at a log file?
If so, could you attach it?

Also, it would be helpful to have the complete kickstart file.
(If you are concerned about any sensitive data, it can be replaced with "xxx".)

Both as separate, uncompressed, text/plain attachments.

Comment 8 David Shea 2013-08-12 12:54:39 UTC
Steve, anaconda should write a "cost=" line in the repo files that it generates when a cost is specified through kickstart. This is not happening.

Comment 9 Steve Tyler 2013-08-12 17:18:32 UTC
I was going to try to reproduce it,
but since you already have it all figured out ...

Comment 10 Ian Collier 2013-08-13 16:20:27 UTC
The complete kickstart file is probably a distraction, since you'd have to edit it anyway - just add the above repo line to any valid kickstart file.

How I know where the packages were installed from: do "yum list installed" and look down the right-hand column.  Logs don't seem to say anything useful.  However, I did also note that files would appear in /tmp/yum.cache/Fedora_19.mirror/packages during the install.

Comment 11 Steve Tyler 2013-08-13 17:59:16 UTC
OK, thanks. Now I understand. You are looking at the repoid column.[1]

During installs and updates from an installed system, this command will show what sites are being used, but I'm not sure how it could be run during a kickstart install:

$ watch -n 1 ss -tar

[1] Called "repo" in the yum man page section on List Options.

Called "repoid" in other parts of the yum man page.

Called "repo id" in the repolist output:
$ sudo yum repolist all

The column header should probably be "repo id/release/arch", AIUI.

Thanks for inspiring me to research these inconsistencies in yum terminology ... :-)

Comment 12 Steve Tyler 2013-08-13 18:38:27 UTC
(In reply to Steve Tyler from comment #11)
...
> During installs and updates from an installed system, this command will show
> what sites are being used, but I'm not sure how it could be run during a
> kickstart install:
> 
> $ watch -n 1 ss -tar
...

During a kickstart install in a VM, "watch -n 1 ss -tar" can be run from a terminal window on the VM host. I was assuming you are doing bare metal installs and not VM installs ...

NB: The "ss" command is not available in the installer environment, although the "watch" command is available.

Comment 13 Steve Tyler 2013-08-14 10:49:53 UTC
Created attachment 786495 [details]
ks-bz995526.cfg F19 kickstart file with two updates repos weighted by cost

Comment 14 Steve Tyler 2013-08-14 11:59:49 UTC
Confirming Ian's result -- there is no "cost" option written to the *.repo files when the attached ks-bz995526.cfg kickstart file is used:

$ ls yum.repos.d/
anaconda.repo  updates-kern.repo  updates-serv.repo

$ cat yum.repos.d/anaconda.repo 
[anaconda]
name=Install - anaconda
enabled=1
baseurl=http://mirrors.kernel.org/fedora/releases/19/Fedora/x86_64/os/

$ cat yum.repos.d/updates-kern.repo 
[updates-kern]
name=Install - updates-kern
enabled=1
baseurl=http://mirrors.kernel.org/fedora/updates/19/x86_64/

$ cat yum.repos.d/updates-serv.repo 
[updates-serv]
name=Install - updates-serv
enabled=1
baseurl=http://mirrors.servercentral.net/fedora/updates/19/x86_64/

$

Comment 15 Steve Tyler 2013-08-14 12:07:07 UTC
Created attachment 786523 [details]
anaconda-ks.cfg without "repo" options from installed F19 system

Further, there are no "repo" options in /root/anaconda-ks.cfg.

Comment 16 Steve Tyler 2013-08-14 12:09:30 UTC
(In reply to Steve Tyler from comment #15)
> Created attachment 786523 [details]
> anaconda-ks.cfg from installed system
> 
> Further, there are no "repo" options in /root/anaconda-ks.cfg.

Ian, could you confirm this with your installed system?

Comment 17 Steve Tyler 2013-08-14 12:14:41 UTC
For the record, testing is in a VM with:

$ qemu-kvm -m 4096 -hda f19-test-2.img -cdrom ~/xfr/fedora/F19/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

The kickstart file is served from the host via NFS by appending this to the kernel command-line:

ks=nfs:walnut.lan:/var/tmp/kickstart/ks-bz995526.cfg

Comment 18 Ian Collier 2013-08-14 15:48:18 UTC
> Further, there are no "repo" options in /root/anaconda-ks.cfg.

Yes, I did notice that.

Comment 19 Steve Tyler 2013-08-14 15:57:45 UTC
Created attachment 786586 [details]
ks-bz995526-f18.cfg F18 kickstart file with two updates repos weighted by cost

NB: yum requires pyxattr, which is not in the Fedora repo, so this uses the Everything repo for the "url" option.

Comment 20 Steve Tyler 2013-08-14 16:07:36 UTC
With F18, the "cost" option is written to the *.repo files when the attached ks-bz995526-f18.cfg kickstart file is used.

$ ls yum.repos.d/
anaconda.repo  updates-kern.repo  updates-serv.repo

$ cat yum.repos.d/anaconda.repo 
[anaconda]
name=Install - anaconda
enabled=1
baseurl=http://mirrors.kernel.org/fedora/releases/18/Everything/x86_64/os/

$ cat yum.repos.d/updates-kern.repo 
[updates-kern]
name=Install - updates-kern
enabled=1
baseurl=http://mirrors.kernel.org/fedora/updates/18/x86_64/
cost=1002

$ cat yum.repos.d/updates-serv.repo 
[updates-serv]
name=Install - updates-serv
enabled=1
baseurl=http://mirrors.servercentral.net/fedora/updates/18/x86_64/
cost=1001

$ 

Tested with:
$ qemu-kvm -m 4096 -hda f18-test-2.img -cdrom ~/xfr/fedora/F18/Fedora-18-x86_64-DVD.iso -vga std -boot menu=on

ks=nfs:walnut.lan:/var/tmp/kickstart/ks-bz995526-f18.cfg

Comment 21 Steve Tyler 2013-08-14 16:52:26 UTC
Created attachment 786614 [details]
anaconda-ks-f18.cfg with "repo" options from installed F18 system

The F18 /root/anaconda-ks.cfg kickstart file has the "repo" options, including the "--cost" suboptions.

Comment 22 Steve Tyler 2013-08-14 17:46:20 UTC
(In reply to Ian Collier from comment #18)
> > Further, there are no "repo" options in /root/anaconda-ks.cfg.
> 
> Yes, I did notice that.

Thanks, Ian.
Bug 997116 - "repo" options not written to /root/anaconda-ks.cfg

Comment 23 Steve Tyler 2013-08-14 21:15:30 UTC
Created attachment 786707 [details]
anaconda-tb-6OLaPX captured while paused at the Reboot button

This dump was captured[1] after the kickstart install was completed, and the installer was paused at the Reboot button.

The problem here is that ksdata did not get dumped:

$ grep -n ksdata anaconda-tb-6OLaPX
879:    _intf.storage.ksdata: Already dumped (AnacondaKSHandler instance)
1075:ksdata: Already dumped (AnacondaKSHandler instance)

$ grep -n AnacondaKSHandler anaconda-tb-6OLaPX
879:    _intf.storage.ksdata: Already dumped (AnacondaKSHandler instance)
935:    _intf.payload.data: Already dumped (AnacondaKSHandler instance)
955:    _intf._currentAction._data: Already dumped (AnacondaKSHandler instance)
974:      _intf._currentAction._spokes._data: Already dumped (AnacondaKSHandler instance)
988:        _intf._currentAction._spokes._advanced._data: Already dumped (AnacondaKSHandler instance)
1015:      _intf._currentAction._spokes._data: Already dumped (AnacondaKSHandler instance)
1075:ksdata: Already dumped (AnacondaKSHandler instance)

$ grep -n cost anaconda-tb-6OLaPX
5739:repo --name=updates-kern    --baseurl=http://mirrors.kernel.org/fedora/updates/19/x86_64/           --cost=1002
5740:repo --name=updates-serv    --baseurl=http://mirrors.servercentral.net/fedora/updates/19/x86_64/    --cost=1001

[1] Captured from the installer console with:
# pkill -USR2 -o anaconda

Tested with:
$ qemu-kvm -m 4096 -hda f19-test-2.img -cdrom ~/xfr/fedora/F19/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

Comment 24 Chris Lumens 2013-08-21 19:33:43 UTC
This does appear to have the same root cause as bug 994940, probably related to e3ce3f19b1d1158c645e848e161e842eba28bccd somehow.  I bet most of those other parameters wouldn't get written out either.

*** This bug has been marked as a duplicate of bug 994940 ***