[CentOS-devel] Image building features enabled in CBS

Ian McLeod

imcleod at redhat.com
Wed Jan 14 14:36:58 UTC 2015


I have made some Factory updates that allow koji, without any additional
patching, to build Vagrant box files directly.  Specifically, box files
that work with the vagrant virtualbox and vagrant libvirt flavors.  I'd
like to work to get these applied to the CBS builder host.

(I'm working on HyperV but have found the Microsoft OVF format to be a
bit more obtuse and difficult than the one for Virtualbox.)

The details are in the commit message here:

https://github.com/redhat-imaging/imagefactory/commit/f51a8da61737b4c664cf22dc17bcb806c601b862

The updated packages are currently in updates-testing for EPEL7 and
updates-stable for F21.  The C7 compatible builds are here:

http://koji.fedoraproject.org/koji/buildinfo?buildID=602669 - imagefactory
http://koji.fedoraproject.org/koji/buildinfo?buildID=602674 -
imagefactory-plugins
http://koji.fedoraproject.org/koji/buildinfo?buildID=600869 - VMDKstream
(This last one is needed to produce streaming VMDK files that are
acceptable to Virtualbox).

In koji these features are available by passing additional keyword
arguments to the existing OVA plugin integration via the CLI.  Adding
these lines, for example, will result in the creation of both a
virtualbox and libvirt "box" file based in an existing image build:

  --format=vsphere-ova \
  --format=rhevm-ova \
  --ova-option vsphere_ova_format=vagrant-virtualbox \
  --ova-option rhevm_ova_format=vagrant-libvirt \

Note that the underlying image must meet a few criteria, described in
the Vagrant documentation, in order to actually work.  Specifically, it
needs to be set up with a "vagrant" user with password-less sudo and a
well known "insecure" authorized_key file (which is replaced when the VM
is first launched).

As a result the underlying disk images are clearly _not_ appropriate for
other image use cases like cloud.  (Though they can be essentially
identical to the cloud images, or Atomic images, etc. in most other ways.)

-Ian


On 11/13/2014 02:50 PM, Ian McLeod wrote:
> Hello all,
> 
> Thanks to Thomas' (alphacc) work last Friday, we now have the image
> building features enable on the CBS koji instance.  I'll give a very
> brief summary of how to use it.  The general form of the koji command is:
> 
> koji -p cbs image-build <image_name> <image_version> <build_target>
>                         <install_tree_url> <arch>
>                         --release <image_release>
>                         --distro <distro_name_version>
>                         --kickstart <local_kickstart_file>
>                         --format <format_type>
>                         --disk-size <disk_size_in_gb>
>                         --repo <repo_url> (optional)
>                         --scratch (optional)
>                         --nowait (optional)
> 
> The image build must be given a name, version and release.  These
> function in much the same way as they do in RPM.  In particular, the
> name must be added as an allowed package in the output tag for the
> <build_target> provided on the command line.
> 
> You can specify more than one --format option.  The most useful options are:
> 
> 'raw-xz' - xz compressed raw file
> 'qcow2' - qcow2
> 'rhevm-ova' - A single file OVF image (aka OVA) for RHEV-M
> 'vsphere-ova' - An OVA for vSphere/VMWare
> 'docker' - A docker base image, suitable for "docker load"
> 
> Any "url" or "repo" lines in your input kickstart file will be removed.
>  The "url" line is replaced by whatever <install_tree_url> you give
> above.  You can, optionally, provide additional repos to Anaconda by
> giving one or more "--repo <url>" arguments.
> 
> Until we sort out how exactly we want kickstart files store in RCM
> (likely git.centos.org) we will be restricted to doing scratch builds,
> indicated with a "--scratch" option above.
> 
> Here is the exact command I used to do initial testing of the feature:
> 
> koji image-build \
>   centos-7-imcleod-test 1 atomic7-el7.centos \
>   http://mirror.centos.org/centos/7/os/x86_64/ x86_64 \
>   --release=1 \
>   --distro RHEL-7.0 \
>   --kickstart=/tmp/RHEL7.auto \
>   --format=qcow2 \
>   --scratch \
>   --nowait \
>   --disk-size=10
> 
> The "RHEL7.auto" kickstart is the minimal/JEOS RHEL7 kickstart from Oz,
> available here:
> 
> https://raw.githubusercontent.com/clalancette/oz/master/oz/auto/RHEL7.auto
> 
> In order for this to work I had to ask alphacc to add me to the "image"
> permission in the CBS.
> 
> I then had to add the centos-7-imcleod-test "package" to the
> "atomic7-testing" tag (which is the destination for the
> "atomic7-el7.centos" build target).  The command to do this was:
> 
> koji add-pkg --owner=imcleod atomic7-testing centos-7-imcleod-test
> 
> Please follow up with questions, thoughts, RFEs, etc.
> 
> -Ian
> _______________________________________________
> CentOS-devel mailing list
> CentOS-devel at centos.org
> http://lists.centos.org/mailman/listinfo/centos-devel
> 
> 




More information about the CentOS-devel mailing list