Hi ,
Packer is running on EKS cluster.
Raw image is stored on S3 bucket
Final image should store on S3 bucket
Raw image is qcow2 file
Need help to create kvm image out of qcow2 file stored in S3 bucket.
Tried below code, getting error:
Code:
{
“variables”: {
“ssh_passwd”: “{{env SSH_PASSWD }}”,
“aws_access_key”: “{{env AWS_ACCESS_KEY }}”,
“aws_secret_key”: “{{env AWS_SECRET_KEY }}”,
“aws_session_token”: “{{env AWS_SESSION_TOKEN }}”,
“aws_role_arn”: “{{env AWS_ROLE_ARN }}”
},
“builders”: [
{
“type”: “qemu”,
“format”: “qcow2”,
“qemu_binary”: “/usr/libexec/qemu-kvm”,
“accelerator”: “kvm”,
“disk_image”: “true”,
“use_backing_file”: “false”,
“iso_url”: “https://packer_test.s3.us-west-1.amazonaws.com/packer_image.qcow2”,
“iso_checksum”: “ced2b0b1a99361f698b063a1c02ea2ac86b2705”,
“vm_name”: “vm_name_test”,
“output_directory”: “image_output_dir”,
“communicator”: “ssh”,
“ssh_username”: “root”,
“ssh_password”: “{{ user ssh_passwd }}”,
“ssh_wait_timeout”: “20m”,
“shutdown_command”: “echo ‘{{ user ssh_passwd }}’ | sudo -S /sbin/halt -h -p”,
“headless”: true,
“memory”: “1024”,
“cpus”: 1
}
],
“provisioners”: [
{
“type”: “shell”,
“inline”: [
“aws s3 cp image_output_dir/packer_image.qcow2 s3://bucket_name/”
]
}
]
}
Error:
e[1;32mqemu: output will be in this color.e[0m
e[1;32m==> qemu: Retrieving ISOe[0m
e[1;32m==> qemu: Trying https://packer_test.s3.us-west-1.amazonaws.com/packer_image.qcow2e[0m
e[1;32m==> qemu: Trying https://packer_test.s3.us-west-1.amazonaws.com/packer_image.qcow2?checksum=sha256%ced2b0b1a99361f698b063a1c02ea2ac86b2705e[0m
e[1;32m==> qemu: Download failed bad response code: 403e[0m
e[1;31m==> qemu: error downloading ISO: [bad response code: 403]e[0m
e[1;31mBuild ‘qemu’ errored after 242 milliseconds 603 microseconds: error downloading ISO: [bad response code: 403]e[0m
==> Wait completed after 242 milliseconds 649 microseconds
==> Some builds didn’t complete successfully and had errors:
→ qemu: error downloading ISO: [bad response code: 403]
==> Builds finished but no artifacts were created.