Bug 1262491 - virt-builder fail to resize or recognize coreos
virt-builder fail to resize or recognize coreos
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Pino Toscano
Virtualization Bugs
Depends On:
Blocks: 1301891 1262621 1288337
  Show dependency treegraph
Reported: 2015-09-11 18:52 EDT by Darius Clark
Modified: 2016-10-28 04:02 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1262621 (view as bug list)
Last Closed: 2016-02-18 04:30:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Log showing error when trying to resize within virt-builder (46.29 KB, text/plain)
2015-09-11 18:52 EDT, Darius Clark
no flags Details
Log that shows what happens without a size argument (46.91 KB, text/plain)
2015-09-11 18:53 EDT, Darius Clark
no flags Details
log showing error with virt-customize and coreos. (88.08 KB, text/plain)
2015-09-12 09:48 EDT, Darius Clark
no flags Details

  None (edit)
Description Darius Clark 2015-09-11 18:52:03 EDT
Created attachment 1072653 [details]
Log showing error when trying to resize within virt-builder

Description of problem:

When running virt-builder with a coreos image, it fails to resize the image according to the size that was given, or if none was give, it fails to recognize the OS, even if virt-inspector recognize the OS.

Version-Release number of selected component (if applicable): 1.30.2

How reproducible: 100%

Steps to Reproduce:
1. Run: "virt-builder -v -x --no-check-signature coreos-stable --format raw -o /tmp/temp-test.img --hostname coreos --no-logfile --size 10G" or "virt-builder -v -x --no-check-signature coreos-stable --format raw -o /tmp/temp-test.img --hostname coreos --no-logfile"

Actual results:

See following attachments.

Additional info:

I am able to resize the images manually with virt-resize but however I am unable to use virt-customize with coreos.
Comment 1 Darius Clark 2015-09-11 18:53:11 EDT
Created attachment 1072654 [details]
Log that shows what happens without a size argument
Comment 3 Richard W.M. Jones 2015-09-12 03:16:58 EDT
The error is:

/dev/sda: Error: /dev/sda: unrecognised disk label

which indicates that the disk image is not recognized -- it might be
compressed, or it might be in the wrong format (eg. qcow2 when you've
told virt-builder that the format is raw, or vice versa).

I grabbed http://stable.release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2
bunzipped it, and used virt-inspector (1.31.5) on it, and that
found the basic OS, and it also has a valid partition table.

Anyway I suspect the input image (/etc/xdg/virt-builder/repos.d/coreos-stable.xz)
is still bzip2 compressed.  You would have to uncompress it before
recompressing it with xz.  (Or I guess you could patch virt-builder
to understand bzip2 compression, but for disk images it makes no sense
as xz is in all ways a better format for disk images).
Comment 4 Darius Clark 2015-09-12 08:43:09 EDT
Hmm the image have been decompressed before it was compressed with xz. The only thing I could possibly think of is that image itself is the format but i would assume that coreos image is raw and not qcow2 but i could double check.
Comment 5 Darius Clark 2015-09-12 09:08:49 EDT
Just to update, it is still giving the same error when changing the format but virt-resize itself is able to resize the image with no problem. Going to dig into virt-builder abit more and see whats going on. Also just to let you know when trying to modify the image with virt-customize, i do get an error as well so maybe its something with libguestfs itself (though it shouldnt be)?
Comment 6 Darius Clark 2015-09-12 09:48:14 EDT
Created attachment 1072716 [details]
log showing error with virt-customize and coreos.
Comment 7 Richard W.M. Jones 2015-09-12 18:15:22 EDT
The virt-customize error (and possibly also therefore the virt-builder
error) is:

[    2.838285] EXT4-fs (sda3): couldn't mount RDWR because of unsupported optional features (ff000000)

This might happen for example because your host is RHEL/CentOS 6
and coreos uses new filesystem features which that old host kernel
doesn't support.  The only solution to that would be to upgrade
the host unfortunately (this is also pretty much the same reason why
we force everyone using virt-v2v to use the latest RHEL host).

I tried to look at what features these correspond to, but these
high bits aren't even mentioned in the latest upstream kernel.  So
either I'm reading the kernel code wrong, or this guest is using
some very strange (non-upstream???) features ...
Comment 8 Richard W.M. Jones 2015-09-13 11:53:32 EDT
For all discussion about the "unsupported optional features" problem,
please use bug 1262621.

For virt-builder, what metadata (index.asc) are you using?  The CoreOS
image turns out to be in qcow2 format; but according to the first log
file, you told virt-builder that the format was raw, so it wouldn't
perform the correct sequence of operations.
Comment 9 Darius Clark 2015-09-13 13:23:24 EDT
This morning I did find out that it was qcow2 (qemu-img info) so i did change the data/format in index.asc (coreos used to be raw in the past and after updating the image i guess i assumed it was still raw but guess it changed at some point in time). I would assume that the format would be converted to raw as it stated in the documents but I guess thats only if the format is correct in index.asc.
Comment 10 Pino Toscano 2015-09-23 11:40:43 EDT
Reading the discussion, it seems like the CoreOS image could not be mounted because of bug 1262621.  Otherwise, libguestfs (since 1.29.45) should support the inspection of CoreOS images.

Regarding the virt-builder image format issue, I read they were fixed by putting format=qcow2 in the virt-builder index.

Are there any issues left?  If so, please paste a logs.
Comment 11 Xianghua Chen 2016-02-18 04:30:09 EST
I can't reproduce it with the following steps:
1. Download from:
2. bunzip2 coreos_production_qemu_image.img.bz2
3. cp coreos_production_qemu_image.img /var/run/guestfs-autotest/images/
4. vim /var/run/guestfs-autotest/images/index.asc
5.virt-builder -v -x --no-check-signature coreos --format raw -o /tmp/temp-test.img --hostname coreos --no-logfile --size 10G
6.virt-builder -v -x --no-check-signature coreos --format raw -o /tmp/temp-test.img --hostname coreos --no-logfile

Step 5&6 can be executed correctly. 
I tried to modify format=qcow2 to format=raw in /var/run/guestfs-autotest/images/index.asc, it will print the error as the attachment. So, this error is confirmed to because of the wrong configure problem, I'll close it as not-a-bug if there is no more issue. 

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