Skip to content

Error creating hard drive during make build-all  #77

@dprosper

Description

@dprosper

What's the issue?

I am runing on Mac OS, downloaded the latest docker image and I get the following error while running the make build-all

ibmcloud-image-builder % docker pull syibm/ibmcloud-image-builder
Using default tag: latest
latest: Pulling from syibm/ibmcloud-image-builder
df20fa9351a1: Pull complete 
5ec5dc15ff53: Pull complete 
a7a1cf7e653d: Pull complete 
Digest: sha256:a07f57d0e849293f6923a7dc33d6f701861cfe8c6024dd297f4ae94c2d8e2240
Status: Downloaded newer image for syibm/ibmcloud-image-builder:latest
docker.io/syibm/ibmcloud-image-builder:latest

ibmcloud-image-builder % docker tag  syibm/ibmcloud-image-builder ibmcloud-image-builder

ibmcloud-image-builder % make build-all
/Applications/Xcode.app/Contents/Developer/usr/bin/make build-image DISTRO_NAME=ubuntu DISTRO_VERSION=bionic TYPE=base
docker run --privileged --rm -v `pwd`:/ibmcloud-image-builder ibmcloud-image-builder:latest /bin/bash -c "./packer-build.sh packer/ubuntu/bionic/base"
++ echo packer/ubuntu/bionic/base
++ sed s#packer/##g
+ IMAGE_DIR=ubuntu/bionic/base
++ echo packer/ubuntu/bionic/base
++ sed s#packer/##g
++ tr / -
+ DIR_TO_FILENAME=ubuntu-bionic-base
+ NEW_IMAGE=output-qemu/ibmcloud-ubuntu-bionic-base-amd64-100G.qcow2
+ ENCRYPTED_IMAGE=output-qemu/ibmcloud-encrypted-ubuntu-bionic-base-amd64-100G.qcow2
+ mkdir -p img/ubuntu-bionic-base
+ cp -r packer/ubuntu/bionic/base/ansible packer/ubuntu/bionic/base/http packer/ubuntu/bionic/base/packer.json packer/ubuntu/bionic/base/shell img/ubuntu-bionic-base
+ cd img/ubuntu-bionic-base
+ '[' -n '' ']'
+ SECRET=JustMySimpleSecret
+ [[ -f ~/.ssh/id_rsa.pub ]]
+ mkdir -p ./ssh
+ chmod 0700 ./ssh
+ ssh-keygen -q -t rsa -b 4096 -C [email protected] -N '' -f ./ssh/id_rsa
+ export PACKER_PUBLIC_KEY=./ssh/id_rsa.pub
+ PACKER_PUBLIC_KEY=./ssh/id_rsa.pub
+ export PACKER_PRIVATE_KEY=./ssh/id_rsa
+ PACKER_PRIVATE_KEY=./ssh/id_rsa
++ cat ./ssh/id_rsa.pub
+ public_key='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDTsJTNJeKl63tKdXUzwRxvksqdpsaFk0O178bNUBBiiI7odeH304ViffauxlG7RpOTGudUK/tJGSK5in5vErENfrdyVs9yEIGWpdEsZLyt3wGX3qhCjpyZoBueGN0a5nkykpqfazaNfjhJ7T1p1U3G0a2ofhfh/M0QiqQLBvEwMQenxmwaeHhfB+wpfPBhND/4nFGcBn9shpSkBN50kiGh8Bl/+zh8qtB0vlMOxsxhCNhZ3U3lhs5vrGz3jvYCGVeF+pUIQmvUfI9IGxC9zPPaRClM+fnvK8a+qAX7txGY2l5f2zQzLFI9RU7Ic+4vTBJpO9sVpZh07/qZp/jnvK1hoNc6xu4I3B+HW3H/M2587XaaHK2ZvL5G8oOUVIbzmbXvP0gm+nQCQNWcoovIcLDL5Yzycbmn82IM2bSs3X8CeO3CKV9L1Q2LTZdtlRRi5ybCFyRtQ3EyBz4A09V+LjNjqv/QovQBl8Fe4oVr2YHj1Y1pMqNPh67uBedjMoxsWh+KxxUzEDObjc9Ax9zzkp6h/+Gsh4YhwUmFOzDr2R1gJFWDDWnxkeLT6pz1dccOxlXreg1NR4+1vnk/zAxiFKN7yA3it35b4lFCD2Mn+hTq0Dz75LaWuTk/qhTswLMKTidDIBdU53oG42hW1aF5lW6/kvvfxx+9PpcpDGAsUq54Kw== [email protected]'
+ cat
+ cloud-localds disk-ssh-pub.img user-data
+ ansible-galaxy install geerlingguy.docker
- downloading role 'docker', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-docker/archive/2.9.0.tar.gz
- extracting geerlingguy.docker to /root/.ansible/roles/geerlingguy.docker
- geerlingguy.docker (2.9.0) was installed successfully
+ rm -rf output-qemu
+ PACKER_LOG=0
+ packer build packer.json
qemu: output will be in this color.

==> qemu: Retrieving ISO
==> qemu: Trying https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
==> qemu: Trying https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img?checksum=sha256%3Ac4517e054c398235aa7a09ddcc1db31cd168077049febcc4292ff77fe1e5eab3
bionic-server-cloudimg-amd64.img 342.81 MiB / 342.81 MiB  100.00% 34s01s
==> qemu: https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img?checksum=sha256%3Ac4517e054c398235aa7a09ddcc1db31cd168077049febcc4292ff77fe1e5eab3 => /ibmcloud-image-builder/img/ubuntu-bionic-base/packer_cache/b6a683c460d3fffb5de20d59dfc847d8bc255295.iso
==> qemu: Copying hard drive...
==> qemu: Error creating hard drive: QemuImg error: qemu-img: error while writing at byte 0: Invalid argument
==> qemu: Deleting output directory...
Build 'qemu' errored: Error creating hard drive: QemuImg error: qemu-img: error while writing at byte 0: Invalid argument

==> Some builds didn't complete successfully and had errors:
--> qemu: Error creating hard drive: QemuImg error: qemu-img: error while writing at byte 0: Invalid argument

==> Builds finished but no artifacts were created.
make[1]: *** [build-image] Error 1
make: *** [ubuntu-bionic-base] Error 2

The same error is seen if I build the docker image locally first, i.e. make pre-build

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions