sahara-image-pack: RHEL-based images can not be generated with various plugins

Bug #1754032 reported by Luigi Toscano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
New
Undecided
Unassigned

Bug Description

The various plugins for Plugin-Declared Image Generation have some trouble with RHEL-based images. Few issues identified so far:

* 'rhel': 'redhat' should be added to _DISTRO_FAMILES in sahara/plugins/images.py; libguestfs identifies RHEL with 'rhel', and otherwise the process bails out;
* few conditionals in the declarative definition of image check/build contains:
  - os_case:
     - centos:

but that should really be 'redhat:' instead, which encompasses both centos and RHEL.

Even when enabling those, there are probably other issues; for example, when generating a MapR image on RHEL, even with the fixes above applied, the process ends with:

[...]
2018-03-06 19:51:34.088 13863 INFO sahara.cli.image_pack.cli [-] Issuing command: rpm -q cups cdparanoia-libs cups-libs createrepo cvs cyrus-sasl-gssapi cyrus-sasl-plain foomatic foomatic-db foomatic-db-f[25/1996]
 foomatic-db-ppds gdbm-devel gettext ghostscript ghostscript-fonts glibc glibc-common glibc-devel glibc-headers gstreamer gstreamer-plugins-base gstreamer-tools hdparm irqbalance iso-codes kernel-headers libXt lib
Xv libXxf86vm libgomp libgudev1 libicu libmng liboil libtheora libtirpc libvisual libxslt mesa-dri-drivers mesa-libGL mesa-libGLU mesa-private-llvm nmap-ncat numactl openjpeg-libs patch pax perl-CGI perl-ExtUtils-
MakeMaker perl-ExtUtils-ParseXS perl-Test-Harness perl-Test-Simple perl-devel phonon-backend-gstreamer poppler poppler-data poppler-utils portreserve qt qt-x11 qt3 redhat-lsb redhat-lsb-core redhat-lsb-printing ur
w-fonts yum-utils xml-common
2018-03-06 19:51:44.297 13863 CRITICAL sahara [-] Unhandled error: RuntimeError: sh:
2018-03-06 19:51:44.297 13863 ERROR sahara Traceback (most recent call last):
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/bin/sahara-image-pack", line 10, in <module>
2018-03-06 19:51:44.297 13863 ERROR sahara sys.exit(main())
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/cli/image_pack/cli.py", line 121, in main
2018-03-06 19:51:44.297 13863 ERROR sahara CONF.root_fs, CONF.test_only)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/cli/image_pack/api.py", line 127, in pack_image
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/mapr/plugin.py", line 108, in pack_image
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/mapr/base/base_version_handler.py", line 193, in pack_image
2018-03-06 19:51:44.297 13863 ERROR sahara remote, test_only=test_only, image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/mapr/images.py", line 31, in pack_image
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 52, in handler
2018-03-06 19:51:44.297 13863 ERROR sahara func(*args, **kwargs)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 411, in validate
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=argument_values)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 892, in validate
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 966, in validate
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 892, in validate
2018-03-06 19:51:44.297 13863 ERROR sahara image_arguments=image_arguments)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 52, in handler
2018-03-06 19:51:44.297 13863 ERROR sahara func(*args, **kwargs)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 532, in validate
2018-03-06 19:51:44.297 13863 ERROR sahara check(self, remote)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 544, in _rpm_check
2018-03-06 19:51:44.297 13863 ERROR sahara return _sudo(remote, check_cmd)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/plugins/images.py", line 1111, in _sudo
2018-03-06 19:51:44.297 13863 ERROR sahara return remote.execute_command(cmd, run_as_root=True, **kwargs)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib/python2.7/site-packages/sahara/cli/image_pack/api.py", line 92, in execute_command
2018-03-06 19:51:44.297 13863 ERROR sahara stdout = self.guest.sh(cmd)
2018-03-06 19:51:44.297 13863 ERROR sahara File "/usr/lib64/python2.7/site-packages/guestfs.py", line 9470, in sh
2018-03-06 19:51:44.297 13863 ERROR sahara r = libguestfsmod.sh(self._o, command)
2018-03-06 19:51:44.297 13863 ERROR sahara RuntimeError: sh:
2018-03-06 19:51:44.297 13863 ERROR sahara

Tested with the last version of sahara-image-pack from the Queens branch, using:

sahara-image-pack --image sahara-rhel7-mapr-5.2.0.qcow2 mapr 5.2.0.mrv2

sahara-rhel7-mapr-5.2.0.qcow2 is a RHEL 7.4 guest image (-191).

(originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=1552596, but it can be fixed for everyone here).

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.