Bug 1418500 - livemedia-creator fails when using %include to specify partitioning
Summary: livemedia-creator fails when using %include to specify partitioning
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lorax
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1420851 1478303
TreeView+ depends on / blocked
 
Reported: 2017-02-02 00:45 UTC by jcastran
Modified: 2018-04-10 17:39 UTC (History)
7 users (show)

Fixed In Version: lorax-19.6.95-1
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
: 1488423 (view as bug list)
Environment:
Last Closed: 2018-04-10 17:38:04 UTC
Target Upstream Version:


Attachments (Terms of Use)
Anaconda Logs from failed livemedia-creator 01783248 (25.58 KB, application/x-bzip)
2017-02-02 00:45 UTC, jcastran
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3110531 0 None None None 2017-09-11 14:04:04 UTC
Red Hat Product Errata RHBA-2018:0947 0 None None None 2018-04-10 17:39:16 UTC

Description jcastran 2017-02-02 00:45:20 UTC
Created attachment 1246931 [details]
Anaconda Logs from failed livemedia-creator 01783248

Description of problem:
when using a kickstart that has the following:
   %pre
   echo "part / --fstype=ext4 --size=4000" > /tmp/partition
   echo "part swap --size=1000" >> /tmp/partition
   %end

Then instead of defining the partitioning in the kickstart, you would use:
   %include /tmp/partition

Which for a normal installation, replaces the %include with the contents of the file specified.

What we found is that instead, the installation fails because there were "No Disks Selected" "Not enough space for installation" (This works if you don't use %pre and %include)


Looking in the shell (virsh console) we can see that the /tmp/partition file does get created. I was able to add the kernel line "text" to stop the installation from dying immediately upon error (defaults to cmdline)

Command:
livemedia-creator --make-disk --ks=rhel7-minimal.ks --iso=rhel-server-7.3-x86_64-boot.iso --image-name=reproducer.img --ram=10240 --tmp=/var/tmp/



Version-Release number of selected component (if applicable):
lorax-19.6.78-1.el7.x86_64



How reproducible:
Everytime

Steps to Reproduce:
1. Create a file with %pre that contains kickstart commands (See above)
2. Replace the partitioning with %include /tmp/filename
3. Run the livemedia-creator command
Command:
   livemedia-creator --make-disk --ks=rhel7-minimal.ks --iso=rhel-server-7.3-x86_64-boot.iso --image-name=reproducer.img --ram=10240 --tmp=/var/tmp/



Actual results:
livemedia-creator fails with:
   Install failed: virt_install failed

Looking at console view of install you can see
   Installation Destination
   (No Disks Selected)
   
   The installation was stopped due to incomplete spokes detected while running in non-interactive cmdline mode. Edit your kickstart file and retry installation.

   The following mandatory spokes are not completed:
   Installation Destination



Expected results:
livemedia-creator creates an img file

Additional info:

Comment 2 Brian Lane 2017-02-02 16:48:21 UTC
%include doesn't work with livemedia-creator, you need a flattened kickstart.

https://rhinstaller.github.io/lorax/livemedia-creator.html#kickstarts

lmc is used to create live iso's and disk images and while it does use Anaconda for the installation it really isn't designed to support advanced partitioning, especially the %pre + %include trick.

Comment 3 Red Hat Bugzilla Rules Engine 2017-02-02 16:48:25 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 4 decandia 2017-02-02 19:31:06 UTC
Brian,

I understand your point, but would you be willing to update the docs to be more specific about the fact that you *must* flatten the kickstart file?  The example is a bit like 'hey this is a simple thing I tried', it's not exactly clear that you must flatten the file because %include syntax is not supported.

-Mike

Comment 5 jcastran 2017-02-02 19:36:24 UTC
Hello,

I am reopening this bug. Customer has requested if we can update the documentation to clearly state this (or if it's already stated, where?)

Thanks,
John Castranio
Red Hat

Comment 11 Jan Stodola 2017-12-05 11:30:40 UTC
This is now documented in /usr/share/doc/lorax-$VERSION/README.livemedia-creator:

...
livemedia-creator parses the 'part /' entry to determine how big a disk image
needs to be created. This means that the common kickstart technique of using
%pre to generate a partition scheme for use with %include will not work. There
needs to be a 'part /' entry in the main part of the kickstart.

Only one kickstart file is supported, so if your kickstart is built from a
number of %include commands it needs to be flattened into a single file with
ksflatten first.

Verified with lorax-19.6.101-1.el7.

Comment 14 errata-xmlrpc 2018-04-10 17:38:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0947


Note You need to log in before you can comment on or make changes to this bug.