Creation of repo mirro fails when importing mini.iso

Bug #765224 reported by Tom Ellis
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cobbler (Ubuntu)
Fix Released
Medium
Andres Rodriguez

Bug Description

Binary package hint: cobbler

Importing the natty mini iso fails as the import detection looks for the dists directory and also cannot determine which ubuntu version it is importing.

Tested using: http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/mini.iso

root@install:~# mount -o loop mini.iso /mnt
root@install:~# cobbler import --name=natty-mini --path=/mnt --breed=ubuntu
task started: 2011-04-18_222035_import
task started (id=Media import, time=Mon Apr 18 22:20:35 2011)
Warning: No distro signature for kernel at /mnt, using value from command line
running: rsync -a '/mnt/' /var/www/cobbler/ks_mirror/natty-mini/ --exclude-from=/etc/cobbler/rsync.exclude --quiet
received on stdout:
received on stderr:
adding distros
associating repos
associating kickstarts
*** TASK COMPLETE ***

After this has imported, it correctly copied created the ks_mirror tree in /var/www/cobbler/ks_mirror/natty-mini but does not create any distro or profile in cobbler.

After adding these manually, I can install systems without issues:
cobbler distro add --name=natty-mini --kernel=/var/www/cobbler/ks_mirror/natty-mini/linux --initrd=/var/www/cobbler/ks_mirror/natty-mini/initrd.gz --arch=x86_64 --breed=ubuntu --os-version=natty
cobbler profile add --name=natty-mini-install --distro=natty-mini --kickstart=/var/lib/cobbler/kickstarts/ubuntu-client.seed
cobbler sync

Related branches

Changed in cobbler (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Marc Cluet (lynxman) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

The server/desktop cdimage is different from the mini.iso. The mini.iso support will have to be added later.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

True, Chuck.

However, the mini.iso is a really convenient and valid way to trigger a network installation.

Brainstorming here in Montreal, we decided that mini.iso's are small enough that we could actually put logic in an Ubuntu Orchestra cronjob that regularly downloads and imports Ubuntu's mini.iso's (if you have network connectivity) such that your Orchestra install is always and automatically able to deploy Ubuntu releases!

Revision history for this message
Tom Ellis (tellis) wrote :

If I specify a os-version it imports the distro and adds distro and profiles to cobbler correctly, however I get a nice traceback.
There must be some code expecting the dists dir somewhere that relies on this for a repo?
Installing after is just fine, although you need to link your profile to a seed file.

$ cobbler import --name=natty-i386 --path=/tmp/tmp.Fk9UxW4Yrv --breed=ubuntu --os-version=natty
task started: 2011-04-21_111651_import
task started (id=Media import, time=Thu Apr 21 11:16:51 2011)
Warning: No distro signature for kernel at /tmp/tmp.Fk9UxW4Yrv, using value from command line
running: rsync -a '/tmp/tmp.Fk9UxW4Yrv/' /var/www/cobbler/ks_mirror/natty-i386/ --exclude-from=/etc/cobbler/rsync.exclude --quiet
received on stdout:
received on stderr:
adding distros
creating new distro: natty-i386
creating new profile: natty-i386
associating repos
traversing distro natty-i386
descent into /tmp/tmp.Fk9UxW4Yrv
Exception occured: <type 'exceptions.TypeError'>
Exception value: process_repos() takes exactly 3 arguments (1 given)
Exception Info:
  File "/usr/lib/python2.7/dist-packages/cobbler/remote.py", line 93, in run
    rc = self._run(self)
   File "/usr/lib/python2.7/dist-packages/cobbler/remote.py", line 227, in runner
    self.logger
   File "/usr/lib/python2.7/dist-packages/cobbler/api.py", line 756, in import_tree
    return manager.run(pkgdir,mirror_url,mirror_name,network_root,kickstart_file,rsync_flags,arch,breed,os_version)
   File "/usr/lib/python2.7/dist-packages/cobbler/modules/manage_import_debian_ubuntu.py", line 249, in run
    self.repo_finder(distros_added)
   File "/usr/lib/python2.7/dist-packages/cobbler/modules/manage_import_debian_ubuntu.py", line 334, in repo_finder
    self.process_repos()

Revision history for this message
Tom Ellis (tellis) wrote :

In fact, it's exactly that.
from: cobbler/modules/manage_import_debian_ubuntu.py
----
    def repo_finder(self, distros_added):
        for distro in distros_added:
            self.logger.info("traversing distro %s" % distro.name)
            # FIXME : Shouldn't decide this the value of self.network_root ?
            if distro.kernel.find("ks_mirror") != -1:
                basepath = os.path.dirname(distro.kernel)
                top = self.get_rootdir()
                self.logger.info("descent into %s" % top)
                dists_path = os.path.join(self.path, "dists")
                if not os.path.isdir(dists_path):
                    self.process_repos()
            else:
                self.logger.info("this distro isn't mirrored")
----

Revision history for this message
Andres Rodriguez (andreserl) wrote :

What appears to be is that the import expects the .disk folder regardless of whether you are specifying the distro or not. Since bug #765254 won't be fixed, I guess that the best approach would be to patch the current code to ignore the check of the .disk folder (or try to obtain the information from there) if we are specifying the distro in the import command.

Does this sound sane?

Revision history for this message
Tom Ellis (tellis) wrote :

Sounds good, for d-i not having the repo present is non-fatal (it'll just grab packages from the internet), for Anaconda based distros (RH, Fedora etc) I think it requires the complete tree.

Changed in cobbler (Ubuntu):
assignee: nobody → Andres Rodriguez (andreserl)
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Ok so after looking at it now, it seems that the issue is self.process_repos() when issuing the following command:

cobbler import --name=natty-i386 --path=/mnt --breed=ubuntu --os-version=natty

Apparently there's some kind of incompatibilities as there are two functions with the same name. One does nothing, the other creates repositories for the newly added distros and is hardcoded to:

repo.set_mirror( "http://ftp.%s.debian.org/debian/dists/%s" % ( 'us' , '@@suite@@' ) )
and
security_repo.set_mirror( "http://security.debian.org/debian-security/dists/%s/updates" % '@@suite@@' )

However, this function doesn't in fact seem to be used at all and I believe it might not even be necessary. or, it was some left over from unfinished code. I'd say that for now, the safest bet would be to not call the function in question to avoid the failure.

When doing so, the mini ISO imports correctly and as mentioned, but it does not point to any preseed (and the ISO doesn't come with any either).

I'll keep investigating but for now It will just be enough to patch that out (ignore the call to the function).

Revision history for this message
Tom Ellis (tellis) wrote :

I think this code is for the repomirror portion of cobbler. It mirrors the archive repositories (using debmirror for debian/ubuntu) for distros that you have imported.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Maybe, unfortunately, this code doesn't seem to be functional at the moment as there's is a empty function with the same name as the previous function. This causes it to fail. Maybe the function with code related to Debian was supposed to be commented out or something. For this reason I believe that the safest bet would be to comment out the call to this function until we implement the reposync , if that's what's the function for.

Changed in cobbler (Ubuntu):
status: Confirmed → In Progress
summary: - import from mini.iso fails
+ Creation of repo mirro fails when importing mini.iso
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cobbler - 2.1.0-0ubuntu8

---------------
cobbler (2.1.0-0ubuntu8) oneiric; urgency=low

  * debian/patches:
    - 41_update_tree_path_with_arch.patch: Update mirror_name to correctly
      reflect path tree patch when specifying arch on import. (LP: #772012)
    - 42_fix_repomirror_create_sync.patch: Fix the creation of a disabled
      repo mirror; enables apt as a repo. (LP: #765224)
    - 43_fix_reposync_env_variable.patch: Fix reposync HOME env variable for
      debmirror by hardcoding to /var/lib/cobbler. (LP: #775946)
 -- Andres Rodriguez <email address hidden> Mon, 02 May 2011 18:26:03 -0400

Changed in cobbler (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.