Skip to content

Instantly share code, notes, and snippets.

@uriinf
Last active July 3, 2020 09:49
Show Gist options
  • Save uriinf/8197161afa0aa511c01a4614127c71dd to your computer and use it in GitHub Desktop.
Save uriinf/8197161afa0aa511c01a4614127c71dd to your computer and use it in GitHub Desktop.
Two secuential packer builds of amazon-ebsvolume type on spot instance. Latest one haven't added tags nor produced artifact_ids on output
$ packer build amazon-ebsvolume.json
amazon-ebsvolume: output will be in this color.
amazon-ebsvolume: Found Image ID: ami-0eb3f07edbf9e6dca
==> amazon-ebsvolume: Creating temporary keypair: packer_5efef9ee-8e20-3ea4-cdff-78601d66f288
==> amazon-ebsvolume: Creating temporary security group for this instance: packer_5efef9f0-cede-f34c-e460-e6dfb9c03184
==> amazon-ebsvolume: Authorizing access to port 22 from [0.0.0.0/0] in the temporary security groups...
==> amazon-ebsvolume: Launching a spot AWS instance...
==> amazon-ebsvolume: Interpolating tags for spot instance...
amazon-ebsvolume: Adding tag: "Name": "Packer Builder"
amazon-ebsvolume: Loading User Data File...
amazon-ebsvolume: Creating Spot Fleet launch template...
amazon-ebsvolume: Sending spot request ()...
amazon-ebsvolume: Instance ID: i-0bc58068b94b4bd49
==> amazon-ebsvolume: Tagging EBS volumes...
==> amazon-ebsvolume: No tags specified for volume on /dev/sda1...
amazon-ebsvolume: Compiling list of tags to apply to volume on /dev/sdb...
amazon-ebsvolume: Adding tag: "Name": "test_sdb"
amazon-ebsvolume: Adding tag: "tag1": "test"
amazon-ebsvolume: Adding tag: "tag2": "tag2"
amazon-ebsvolume: Compiling list of tags to apply to volume on /dev/sdc...
amazon-ebsvolume: Adding tag: "tag1": "test"
amazon-ebsvolume: Adding tag: "tag2": "tag2"
amazon-ebsvolume: Adding tag: "Name": "test_sdc"
amazon-ebsvolume: Applying tags to EBS Volume: vol-0231f5994999f4191
amazon-ebsvolume: Applying tags to EBS Volume: vol-01ccd32444c30ef6f
==> amazon-ebsvolume: Using ssh communicator to connect: 34.239.233.245
==> amazon-ebsvolume: Waiting for SSH to become available...
==> amazon-ebsvolume: Connected to SSH!
==> amazon-ebsvolume: Provisioning with shell script: /var/folders/q0/88bcvyv10c5dk19w92qc6vyr0000gn/T/packer-shell340888243
amazon-ebsvolume: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT NAME LABEL
amazon-ebsvolume: nvme0n1 259:1 0 8G 0 disk nvme0n1
amazon-ebsvolume: └─nvme0n1p1 259:2 0 8G 0 part / └─nvme0n1p1
amazon-ebsvolume: nvme1n1 259:0 0 1G 0 disk nvme1n1
amazon-ebsvolume: nvme2n1 259:3 0 1G 0 disk nvme2n1
==> amazon-ebsvolume: Terminating the source AWS instance...
==> amazon-ebsvolume: Deleting temporary security group...
==> amazon-ebsvolume: Deleting temporary keypair...
==> amazon-ebsvolume: Created Volumes: EBS Volumes were created:
==> amazon-ebsvolume:
==> amazon-ebsvolume: us-east-1:vol-01ccd32444c30ef6f
==> amazon-ebsvolume: us-east-1:vol-0231f5994999f4191
==> amazon-ebsvolume: Running post-processor: manifest
==> amazon-ebsvolume: Running post-processor: shell-local
==> amazon-ebsvolume (shell-local): Running local shell script: /var/folders/q0/88bcvyv10c5dk19w92qc6vyr0000gn/T/packer-shell358251355
amazon-ebsvolume (shell-local): {
amazon-ebsvolume (shell-local): "name": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "builder_type": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "build_time": 1593768538,
amazon-ebsvolume (shell-local): "files": null,
amazon-ebsvolume (shell-local): "artifact_id": "us-east-1:vol-01ccd32444c30ef6f,us-east-1:vol-0231f5994999f4191",
amazon-ebsvolume (shell-local): "packer_run_uuid": "6465e37e-05d0-81d8-51c6-0a5750318a5f",
amazon-ebsvolume (shell-local): "custom_data": null
amazon-ebsvolume (shell-local): }
Build 'amazon-ebsvolume' finished.
==> Builds finished. The artifacts of successful builds are:
--> amazon-ebsvolume: EBS Volumes were created:
us-east-1:vol-01ccd32444c30ef6f
us-east-1:vol-0231f5994999f4191
--> amazon-ebsvolume:
--> amazon-ebsvolume:
$ packer build amazon-ebsvolume.json
amazon-ebsvolume: output will be in this color.
amazon-ebsvolume: Found Image ID: ami-0eb3f07edbf9e6dca
==> amazon-ebsvolume: Creating temporary keypair: packer_5efefa95-3d98-59ff-a7a9-5ba487659dc8
==> amazon-ebsvolume: Creating temporary security group for this instance: packer_5efefa97-e073-990c-04d5-0c30b7835006
==> amazon-ebsvolume: Authorizing access to port 22 from [0.0.0.0/0] in the temporary security groups...
==> amazon-ebsvolume: Launching a spot AWS instance...
==> amazon-ebsvolume: Interpolating tags for spot instance...
amazon-ebsvolume: Adding tag: "Name": "Packer Builder"
amazon-ebsvolume: Loading User Data File...
amazon-ebsvolume: Creating Spot Fleet launch template...
amazon-ebsvolume: Sending spot request ()...
amazon-ebsvolume: Instance ID: i-0706271133754feaf
==> amazon-ebsvolume: Tagging EBS volumes...
==> amazon-ebsvolume: No tags specified for volume on /dev/sda1...
amazon-ebsvolume: Compiling list of tags to apply to volume on /dev/sdb...
amazon-ebsvolume: Adding tag: "tag2": "tag2"
amazon-ebsvolume: Adding tag: "Name": "test_sdb"
amazon-ebsvolume: Adding tag: "tag1": "test"
amazon-ebsvolume: Compiling list of tags to apply to volume on /dev/sdc...
amazon-ebsvolume: Adding tag: "tag1": "test"
amazon-ebsvolume: Adding tag: "tag2": "tag2"
amazon-ebsvolume: Adding tag: "Name": "test_sdc"
==> amazon-ebsvolume: Using ssh communicator to connect: 100.26.242.118
==> amazon-ebsvolume: Waiting for SSH to become available...
==> amazon-ebsvolume: Connected to SSH!
==> amazon-ebsvolume: Provisioning with shell script: /var/folders/q0/88bcvyv10c5dk19w92qc6vyr0000gn/T/packer-shell517819631
amazon-ebsvolume: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT NAME LABEL
amazon-ebsvolume: nvme0n1 259:2 0 8G 0 disk nvme0n1
amazon-ebsvolume: └─nvme0n1p1 259:3 0 8G 0 part / └─nvme0n1p1
amazon-ebsvolume: nvme1n1 259:1 0 1G 0 disk nvme1n1
amazon-ebsvolume: nvme2n1 259:0 0 1G 0 disk nvme2n1
==> amazon-ebsvolume: Terminating the source AWS instance...
==> amazon-ebsvolume: Deleting temporary security group...
==> amazon-ebsvolume: Deleting temporary keypair...
==> amazon-ebsvolume: Created Volumes: EBS Volumes were created:
==> amazon-ebsvolume:
==> amazon-ebsvolume:
==> amazon-ebsvolume: Running post-processor: manifest
==> amazon-ebsvolume: Running post-processor: shell-local
==> amazon-ebsvolume (shell-local): Running local shell script: /var/folders/q0/88bcvyv10c5dk19w92qc6vyr0000gn/T/packer-shell234347183
amazon-ebsvolume (shell-local): {
amazon-ebsvolume (shell-local): "name": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "builder_type": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "build_time": 1593768538,
amazon-ebsvolume (shell-local): "files": null,
amazon-ebsvolume (shell-local): "artifact_id": "us-east-1:vol-01ccd32444c30ef6f,us-east-1:vol-0231f5994999f4191",
amazon-ebsvolume (shell-local): "packer_run_uuid": "6465e37e-05d0-81d8-51c6-0a5750318a5f",
amazon-ebsvolume (shell-local): "custom_data": null
amazon-ebsvolume (shell-local): }
amazon-ebsvolume (shell-local): {
amazon-ebsvolume (shell-local): "name": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "builder_type": "amazon-ebsvolume",
amazon-ebsvolume (shell-local): "build_time": 1593768688,
amazon-ebsvolume (shell-local): "files": null,
amazon-ebsvolume (shell-local): "artifact_id": "",
amazon-ebsvolume (shell-local): "packer_run_uuid": "7561fe21-ea1b-f1e5-0646-154a56dadf32",
amazon-ebsvolume (shell-local): "custom_data": null
amazon-ebsvolume (shell-local): }
Build 'amazon-ebsvolume' finished.
==> Builds finished. The artifacts of successful builds are:
--> amazon-ebsvolume: EBS Volumes were created:
--> amazon-ebsvolume:
--> amazon-ebsvolume:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment