Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing a distro with --available-as is totally broken in 2.2.3 #289

Closed
jonathanunderwood opened this issue Sep 4, 2012 · 2 comments
Closed

Comments

@jonathanunderwood
Copy link
Contributor

Something has totally clobbered distro importing in 2.2.3 when using --available-as.

The old, correct behaviour

With an earlier cobbler (I think 2.2.2), the following command:

cobbler import --path=/srv/www/repos.theory.phys.ucl.ac.uk/mirrors/SL/6.2/x86_64/os --breed=redhat --name=SL-6.2-x86_64 --available-as=http://repos.theory.phys.ucl.ac.uk/mirrors/SL/6.2/x86_64/os

successfully created a distro without creating a local mirror under /var/www/cobbler/ks_mirror, as it should.

$ cobbler distro report --name=SL-6.2-x86_64
Name : SL-6.2-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /srv/www/repos.theory.phys.ucl.ac.uk/mirrors/SL/6.2/x86_64/os/images/pxeboot/initrd.img
Kernel : /srv/www/repos.theory.phys.ucl.ac.uk/mirrors/SL/6.2/x86_64/os/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {'tree': 'http://repos.theory.phys.ucl.ac.uk/mirrors/SL/6.2/x86_64/os'}
Management Classes : []
OS Version : generic26
Owners : ['admin']
Red Hat Management Key : <>
Red Hat Management Server : <>
Template Files : {}

Notice the value of "Kickstart Metadata". [Although, notice that the Initrd and Kernel are set to /srv/... rather than under /var/www/cobbler/ks_mirror, which I think is incorrect].

The 2.2.3 behaviour

The following command:

$ cobbler import --path=/srv/www/repos.theory.phys.ucl.ac.uk/mirrors/SL/6.3/x86_64/os --breed=redhat --name=SL-6.3-x86_64 --available-as="http://repos.theory.phys.ucl.ac.uk/mirrors/SL/6.3/x86_64/os

now creates an entire mirror of the distro under /var/www/cobbler/ks_mirror:

$ ls -l /var/www/cobbler/ks_mirror/
total 8
drwxr-xr-x. 2 root root 4096 Jun 18 02:04 config
drwxr-xr-x. 8 root root 4096 Aug 22 16:35 SL-6.3-x86_64

$ du -sh /var/www/cobbler/ks_mirror/SL-6.3-x86_64/
5.4G /var/www/cobbler/ks_mirror/SL-6.3-x86_64/

And:

$ cobbler distro report --name=SL-6.3-x86_64
Name : SL-6.3-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/SL-6.3-x86_64/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/SL-6.3-x86_64/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {'tree': 'http://repos.theory.phys.ucl.ac.uk/mirrors/SL/6.3/x86_64/os/var/www/cobbler/ks_mirror/SL-6.3-x86_64'}
Management Classes : []
OS Version : generic26
Owners : ['admin']
Red Hat Management Key : <>
Red Hat Management Server : <>
Template Files : {}

Note the mangled Kickstart Metadata.

@jonathanunderwood
Copy link
Contributor Author

I think for the use case described above the correct behaviour would be:

  1. Copy the initrd and kernel somewhere suitable under /var to be served up by TFTP (this wasn't done correctly in the old case) - the Old behaviour actually used the location from where the distro was imported, which, if it was a mounted DVD say, might not be available later.

  2. Set the Kickstart Metadata 'tree' value to be the address passed with the --available-as option.

@jonathanunderwood
Copy link
Contributor Author

Aha! Today I tried the trunk version as I noticed a patch related to --available-as has been commited, and it now works exactly as I would expect:

$ cobbler distro report --name=SL-6.3-x86_64
Name : SL-6.3-x86_64
Architecture : x86_64
TFTP Boot Files : {}
Breed : redhat
Comment :
Fetchable Files : {}
Initrd : /var/www/cobbler/ks_mirror/SL-6.3-x86_64/images/pxeboot/initrd.img
Kernel : /var/www/cobbler/ks_mirror/SL-6.3-x86_64/images/pxeboot/vmlinuz
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart Metadata : {'tree': 'http://repos.theory.phys.ucl.ac.uk/mirrors/SL/6.3/x86_64/os/'}
Management Classes : []
OS Version : generic26
Owners : ['admin']
Red Hat Management Key : <>
Red Hat Management Server : <>
Template Files : {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant