Bug 995526 - regression: --cost ignored in kickstart file
regression: --cost ignored in kickstart file
Status: CLOSED DUPLICATE of bug 994940
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Anaconda Maintenance Team
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-09 11:37 EDT by Ian Collier
Modified: 2013-08-21 15:33 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-21 15:33:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ks-bz995526.cfg F19 kickstart file with two updates repos weighted by cost (514 bytes, text/plain)
2013-08-14 06:49 EDT, Steve Tyler
no flags Details
anaconda-ks.cfg without "repo" options from installed F19 system (754 bytes, text/plain)
2013-08-14 08:07 EDT, Steve Tyler
no flags Details
ks-bz995526-f18.cfg F18 kickstart file with two updates repos weighted by cost (598 bytes, text/plain)
2013-08-14 11:57 EDT, Steve Tyler
no flags Details
anaconda-ks-f18.cfg with "repo" options from installed F18 system (823 bytes, text/plain)
2013-08-14 12:52 EDT, Steve Tyler
no flags Details
anaconda-tb-6OLaPX captured while paused at the Reboot button (388.61 KB, text/plain)
2013-08-14 17:15 EDT, Steve Tyler
no flags Details

  None (edit)
Description Ian Collier 2013-08-09 11:37:14 EDT
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 13:39:43 EDT
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 17:44:06 EDT
>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 18:08:53 EDT
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 18:10:48 EDT
(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 16:11:21 EDT
(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 18:32:47 EDT
> Did you try F18?

Sorry, I skipped 18 (or rather, used FedUp) so have no data on that.
Comment 7 Steve Tyler 2013-08-11 23:21:47 EDT
(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 08:54:39 EDT
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 13:18:32 EDT
I was going to try to reproduce it,
but since you already have it all figured out ...
Comment 10 Ian Collier 2013-08-13 12:20:27 EDT
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 13:59:16 EDT
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 14:38:27 EDT
(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 06:49:53 EDT
Created attachment 786495 [details]
ks-bz995526.cfg F19 kickstart file with two updates repos weighted by cost
Comment 14 Steve Tyler 2013-08-14 07:59:49 EDT
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 08:07:07 EDT
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 08:09:30 EDT
(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 08:14:41 EDT
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 11:48:18 EDT
> Further, there are no "repo" options in /root/anaconda-ks.cfg.

Yes, I did notice that.
Comment 19 Steve Tyler 2013-08-14 11:57:45 EDT
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 12:07:36 EDT
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 12:52:26 EDT
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 13:46:20 EDT
(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 17:15:30 EDT
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 15:33:43 EDT
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 ***

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