purpleidea / vagrant-builder

an elegant method for making base images for vagrant-libvirt
GNU Affero General Public License v3.0
42 stars 23 forks source link

virt-builder target fails when running virt-resize on .xz image #10

Closed vvaldez closed 8 years ago

vvaldez commented 9 years ago

The following was run on Fedora 22 x86_64 with: libguestfs-tools.noarch 1:1.29.46-1.fc22 libvirt.x86_64 1.2.13.1-2.fc22 qemu-kvm.x86_64 2:2.3.0-3.fc22 virt-install.noarch 1.2.1-1.fc22

The image is installed with virt-install and the xz target completes. However, during the builder target, virt-builder fails with the following error (I added an @echo line to display the command and arguments):

[vvaldez@vvaldez v7]$ ./versions/rhel-7.1-iso.sh
Running templater...
Running virt-builder...
virt-builder --fingerprint  --source /home/vvaldez/tmp/builder/rhel-7.1-iso/index --no-check-signature --no-cache rhel-7.1 --run-command echo "USERNAME='REDACTED';PASSWORD='REDACTED';ATTACH='--auto';REPOS='rhel-7-server-rpms rhel-7-server-extras-rpms'" > /root/subscribe.input.sh --run files/subscribe.sh --upload repos/el7-puppet.repo:/etc/yum.repos.d/ --upload repos/epel7.repo:/etc/yum.repos.d/ --upload repos/epel7-testing.repo:/etc/yum.repos.d/ --upload keys/RPM-GPG-KEY-EPEL-7:/etc/pki/rpm-gpg/ --upload keys/RPM-GPG-KEY-puppetlabs:/etc/pki/rpm-gpg/ --output /home/vvaldez/tmp/builder/rhel-7.1-iso/builder.img --format qcow2 --size 40G --install rsync,nfs-utils,sudo,openssh-server,openssh-clients,screen,tar --root-password file:files/password --run-command yum erase -y vim-minimal || true --run-command yum install -y sudo vim-enhanced || true --run-command yum install -y puppet || true --upload files/docker.sh:/root/docker.sh --run-command yum install -y docker psmisc || true --run-command systemctl enable docker || true --run-command /root/docker.sh pull  && rm /root/docker.sh --upload files/yum.sh:/root/yum.sh --run-command /root/yum.sh install sudo vim-enhanced git wget file man tree nmap tcpdump htop lsof telnet mlocate bind-utils koan iftop yum-utils nc psmisc bash-completion && rm /root/yum.sh --run-command yum update -y --run files/user.sh --run files/ssh.sh --run files/network.sh --run files/cleanup.sh --run-command if (test "vinny.valdez@redhat.com" != "" && test "muWuZcnVmN" != ""); then subscription-manager unregister; fi --run-command touch /.autorelabel
[   0.7] Downloading: /home/vvaldez/tmp/builder/rhel-7.1-iso/../../../../../home/vvaldez/tmp/builder/rhel-7.1-iso/rhel-7.1.xz
[   1.8] Planning how to build this image
[   1.8] Uncompressing
[  11.4] Resizing (using virt-resize) to expand the disk to 40.0G
virt-resize: error: libguestfs error: part_get_parttype: unknown signature,
                              of the output:
BYT;

If reporting bugs, run virt-resize with debugging enabled and include the
complete output:

  virt-resize -v -x [...]
Makefile:191: recipe for target '/home/vvaldez/tmp/builder/rhel-7.1-iso/builder.img' failed
make: *** [/home/vvaldez/tmp/builder/rhel-7.1-iso/builder.img] Error 1
rwmjones commented 9 years ago

I don't quite understand why the error affects virt-builder. Is the disk blank?

Anyway, it does sound a lot like a bug in libguestfs which I fixed upstream: https://github.com/libguestfs/libguestfs/commit/b467afb621b054e4c1e9a2f1e8814e91a395ffb7

purpleidea commented 9 years ago

I'll admit I haven't tried vagrant-builder on F22, only F21... It did previously work there, though.

vvaldez commented 9 years ago

FYI, confirmed this works in Fedora 21 (not updated) with libguestfs 1:1.28.10-1.fc21. Will try rwmjones patches on F22 next.

purpleidea commented 8 years ago

Closing because fixed upstream. F21 EOL