[PATCH] add support for Image Factory generation of VMWare Fusion Vagrant boxes

Ian McLeod imcleod at redhat.com
Fri Sep 11 18:25:32 UTC 2015


---
 builder/kojid | 11 +++++++++--
 cli/koji      |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/builder/kojid b/builder/kojid
index c0759a8..4ea93f2 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -3063,7 +3063,7 @@ class BaseImageTask(OzImageTask):
         Some image formats require others to be processed first, which is why
         we have to do this. raw files in particular may not be kept.
         """
-        supported = ('raw', 'raw-xz', 'vmdk', 'qcow', 'qcow2', 'vdi', 'rhevm-ova', 'vsphere-ova', 'docker', 'vagrant-virtualbox', 'vagrant-libvirt', 'vpc')
+        supported = ('raw', 'raw-xz', 'vmdk', 'qcow', 'qcow2', 'vdi', 'rhevm-ova', 'vsphere-ova', 'docker', 'vagrant-virtualbox', 'vagrant-libvirt', 'vagrant-vmware-fusion', 'vpc')
         for f in formats:
             if f not in supported:
                 raise koji.ApplianceError('Invalid format: %s' % f)
@@ -3098,6 +3098,7 @@ class BaseImageTask(OzImageTask):
                   'vsphere-ova': self._buildOVA,
                   'vagrant-virtualbox': self._buildOVA,
                   'vagrant-libvirt':    self._buildOVA,
+                  'vagrant-vmware-fusion': self._buildOVA,
                   'docker':      self._buildDocker
         }
         # add a handler to the logger so that we capture ImageFactory's logging
@@ -3247,8 +3248,14 @@ class BaseImageTask(OzImageTask):
         if format == 'vagrant-libvirt':
             format = 'rhevm-ova'
             img_opts['rhevm_ova_format'] = 'vagrant-libvirt'
+        if format == 'vagrant-vmware-fusion':
+            format = 'vsphere-ova'
+            img_opts['vsphere_ova_format'] = 'vagrant-vmware-fusion'
+            # The initial disk image transform for VMWare Fusion/Workstation requires a "standard" VMDK
+            # not the stream oriented format used for VirtualBox or regular VMWare OVAs
+            img_opts['vsphere_vmdk_format'] = 'standard'
         targ = self._do_target_image(self.base_img.base_image.identifier,
-            format.replace('-ova', ''))
+            format.replace('-ova', ''), img_opts=img_opts)
         targ2 = self._do_target_image(targ.target_image.identifier, 'OVA',
             img_opts=img_opts)
         return {'image': targ2.target_image.data}
diff --git a/cli/koji b/cli/koji
index 47d9691..c74171c 100755
--- a/cli/koji
+++ b/cli/koji
@@ -5265,7 +5265,7 @@ def handle_image_build(options, session, args):
     """Create a disk image given an install tree"""
     formats = ('vmdk', 'qcow', 'qcow2', 'vdi', 'vpc', 'rhevm-ova',
                'vsphere-ova', 'vagrant-virtualbox', 'vagrant-libvirt',
-               'docker', 'raw-xz')
+               'vagrant-vmware-fusion', 'docker', 'raw-xz')
     usage = _("usage: %prog image-build [options] <name> <version> " +
               "<target> <install-tree-url> <arch> [<arch>...]")
     usage += _("\n       %prog image-build --config FILE")
-- 
2.1.0



More information about the buildsys mailing list