6 Replies Latest reply: Jan 12, 2012 2:58 PM by msavy RSS

    Specifying additional repos causes error

    tiradani Newbie

      Hi,

       

      According to http://boxgrinder.org/tutorials/appliance-definition/, when you specify an additional repo in appliance definition file, it should be installed on the appliance.  However, I am getting a GuestFS error after the appliance has been installed:

       

      D, [2012-01-09T14:44:33.159317 #8867] DEBUG -- : Installing repositories from appliance definition file...

      D, [2012-01-09T14:44:33.159385 #8867] DEBUG -- : Installing base repo...

      D, [2012-01-09T14:44:33.159773 #8867] DEBUG -- : GFS: write_file "/etc/yum.repos.d/base.repo" "[base]

      name=base

      enabled=1

      gpgcheck=0

      baseurl=ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/SL

      " 0

      D, [2012-01-09T14:44:33.163469 #8867] DEBUG -- : GFS: write_file = -1 (error)

      F, [2012-01-09T14:44:33.163727 #8867] FATAL -- : Guestfs::Error: write_file: open: /etc/yum.repos.d/base.repo: No such file or directory

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:267:in `write_file'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:267:in `install_repos'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:254:in `each'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:254:in `install_repos'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:89:in `build_with_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/image-helper.rb:130:in `customize'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:176:in `customize'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:123:in `initialize_guestfs'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:169:in `prepare_guestfs'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:123:in `initialize_guestfs'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:77:in `log_callback'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:123:in `initialize_guestfs'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/guestfs-helper.rb:173:in `customize'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/helpers/image-helper.rb:129:in `customize'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:76:in `build_with_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb:33:in `build_rhel'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/os/sl/sl-plugin.rb:50:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/plugins/base-plugin.rb:172:in `run'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:174:in `execute_plugin'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `each'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:121:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/lib/boxgrinder-build/appliance.rb:154:in `create'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.0/bin/boxgrinder-build:189

      /usr/bin/boxgrinder-build:19:in `load'

      /usr/bin/boxgrinder-build:19

       

      Any ideas?  Do you need the full log?  This is the only error in the log, everything else looks normal.  Additionally, if I do not specify my own repos, the build succeeds. 

       

      My appliance deinition file (with password removed)

       

      name: sl5

      summary:  sl5

       

      os:

        name: sl

        version: 5

        password: XXX

       

      hardware:

        partitions:

          "/":

            size: 10

       

      default_repos: false

       

      repos:

        - name: "base"

          baseurl: "ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/SL"

        - name: "Security"

          baseurl: "ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/updates/security"

        - name: "Contrib"

          baseurl: "ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/contrib"

        - name: "FastBugs"

          baseurl: "ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/updates/fastbugs"

        - name: "Fermi-Site"

          baseurl: "ftp://linux.fnal.gov/linux/fermi/slf57/x86_64/sites/Fermi/SITERPMS/"

        - name: "EPEL"

          baseurl: "http://download.fedora.redhat.com/pub/epel/5/x86_64/"

       

       

      packages:

        - @core

        - vim-enhanced

        - openssh

        - openssh-server

        - wget

        - curl

        - python

        - libxslt

        - sysklogd

        - ntp

        - dhclient

        - iputils

        - krb5-libs

        - krb5-workstation

       

       

      files:

        "/root":

          - "sl5-context.sh"

       

      post:

        base:

          - "/bin/mkdir -p /etc/yum.repos.d/"

          - "/sbin/chkconfig ntpd on"

          - "/sbin/chkconfig iptables off"

          - "/sbin/chkconfig ip6tables off"

          - "chmod +x /root/sl5-context.sh"

          - "/root/sl5-context.sh"