Closed syyang-in-cloud closed 4 years ago
It's weird, the PR pipeline was successful but the status isn't updated here: https://travis-ci.org/github/IBM-Cloud/ibmcloud-image-builder/builds/703568289
I am going to merge, the test was successful:
qemu: changed: [default]
7956 qemu:
7957 qemu: TASK [debug] *******************************************************************
7958 qemu: ok: [default] => {
7959 qemu: "msg": "Hello World!\nDistributor ID:\tUbuntu\nDescription:\tUbuntu 18.04.4 LTS\nRelease:\t18.04\nCodename:\tbionic"
7960 qemu: }
7961 qemu:
7962 qemu: PLAY RECAP *********************************************************************
7963 qemu: default : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
7964 qemu:
79652020/06/30 15:11:38 packer-provisioner-ansible plugin: shutting down the SSH proxy
79662020/06/30 15:11:38 [INFO] (telemetry) ending ansible
7967==> qemu: Gracefully halting virtual machine...
79682020/06/30 15:11:38 packer-builder-qemu plugin: Executing shutdown command: rm -f /home/ubuntu/.ssh/authorized_keys && sudo rm -f /root/.ssh/authorized_keys && echo 'packer' | sudo -S shutdown -P now
79692020/06/30 15:11:38 packer-builder-qemu plugin: [DEBUG] Opening new ssh session
79702020/06/30 15:11:38 packer-builder-qemu plugin: [DEBUG] starting remote command: rm -f /home/ubuntu/.ssh/authorized_keys && sudo rm -f /root/.ssh/authorized_keys && echo 'packer' | sudo -S shutdown -P now
79712020/06/30 15:11:41 packer-builder-qemu plugin: [ERROR] Remote command exited without exit status or exit signal.
79722020/06/30 15:11:41 packer-builder-qemu plugin: Waiting max 5m0s for shutdown to complete
79732020/06/30 15:13:15 packer-builder-qemu plugin: VM shut down.
7974==> qemu: Converting hard drive...
79752020/06/30 15:13:15 packer-builder-qemu plugin: Executing qemu-img: []string{"convert", "-O", "qcow2", "output-qemu/ubuntu-bionic.qcow2", "output-qemu/ubuntu-bionic.qcow2.convert"}
79762020/06/30 15:13:17 packer-builder-qemu plugin: stdout:
79772020/06/30 15:13:17 packer-builder-qemu plugin: stderr:
79782020/06/30 15:13:21 packer-builder-qemu plugin: failed to unlock port lockfile: close tcp 127.0.0.1:5977: use of closed network connection
79792020/06/30 15:13:21 packer-builder-qemu plugin: failed to unlock port lockfile: close tcp 127.0.0.1:3344: use of closed network connection
7980Build 'qemu' finished.
7981
7982==> Builds finished. The artifacts of successful builds are:
7983--> qemu: VM files in directory: output-qemu
79842020/06/30 15:13:21 [INFO] (telemetry) ending qemu
7985==> Builds finished. The artifacts of successful builds are:
79862020/06/30 15:13:21 machine readable: qemu,artifact-count []string{"1"}
79872020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "builder-id", "transcend.qemu"}
79882020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "id", "VM"}
79892020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "string", "VM files in directory: output-qemu"}
79902020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "files-count", "1"}
79912020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "file", "0", "output-qemu/ubuntu-bionic.qcow2"}
79922020/06/30 15:13:21 machine readable: qemu,artifact []string{"0", "end"}
79932020/06/30 15:13:21 [INFO] (telemetry) Finalizing.
79942020/06/30 15:13:21 waiting for all plugin processes to complete...
79952020/06/30 15:13:21 /usr/local/bin/packer: plugin process exited
79962020/06/30 15:13:21 /usr/local/bin/packer: plugin process exited
79972020/06/30 15:13:21 /usr/local/bin/packer: plugin process exited
7998+ NEW_IMAGE=output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2
7999+ ENCRYPTED_IMAGE=output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G-encrypted.qcow2
8000+ qemu-img resize output-qemu/ubuntu-bionic.qcow2 100G
8001Image resized.
8002+ qemu-img convert -f qcow2 -O qcow2 output-qemu/ubuntu-bionic.qcow2 output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2
8003+ qemu-img info output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2
8004image: output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2
8005file format: qcow2
8006virtual size: 100 GiB (107374182400 bytes)
8007disk size: 1.03 GiB
8008cluster_size: 65536
8009Format specific information:
8010 compat: 1.1
8011 lazy refcounts: false
8012 refcount bits: 16
8013 corrupt: false
8014+ rm output-qemu/ubuntu-bionic.qcow2
8015+ '[' -n '' ']'
8016+ SECRET=JustMySimpleSecret
8017++ base64
8018++ echo -n JustMySimpleSecret
8019+ BASE64_ENCODED_SECRET=SnVzdE15U2ltcGxlU2VjcmV0
8020+ qemu-img convert -O qcow2 --object secret,id=sec0,format=base64,data=SnVzdE15U2ltcGxlU2VjcmV0 -o encrypt.format=luks,encrypt.key-secret=sec0 output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2 output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G-encrypted.qcow2
8021+ qemu-img compare --object secret,id=sec0,format=base64,data=SnVzdE15U2ltcGxlU2VjcmV0 --image-opts driver=qcow2,file.filename=output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G.qcow2 driver=qcow2,encrypt.key-secret=sec0,file.filename=output-qemu/ibmcloud-ubuntu-bionic-cloudimg-amd64-100G-encrypted.qcow2
8022Images are identical.
8023+ rm -rf output-qemu
8024+ rm -rf packer_cache
8025+ rm -rf ./ssh
8026+ rm -f user-data
8027+ rm -f disk-ssh-pub.img
8028The command "make" exited with 0.
8029
8030
8031Done. Your build exited with 0.
Summary
This PR is to resolve the issues : issue-8 and some more to prepare issue-16.
Description
Piggybacked:
playbook-docker.yml
for the next custom imagerequirements.txt
: ansible-lint, dockerTests
Manual Test Results as below. Confirmed the
Ansible
provisioner with the ubuntu release number:Manual Test Environment:
Base Image: Ansible Playbook
Tested Extra Playbook for the next Issue issue-16 :
playbook-docker.yml