Red Hat Bugzilla – Bug 1262491
virt-builder fail to resize or recognize coreos
Last modified: 2016-10-28 04:02:10 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"
See following attachments.
I am able to resize the images manually with virt-resize but however I am unable to use virt-customize with coreos.
Created attachment 1072654 [details]
Log that shows what happens without a size argument
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).
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.
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)?
Created attachment 1072716 [details]
log showing error with virt-customize and coreos.
The virt-customize error (and possibly also therefore the virt-builder
[ 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 ...
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.
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.
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.
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.