Importing OVA into AWS fails with Unsupported kernel version 4.15.0-1021-aws

1,433 views
Skip to first unread message

vi...@ucsb.edu

unread,
Sep 14, 2018, 3:55:17 PM9/14/18
to Packer
I am building an image from athe Ubuntu 18.04 LTS ISO, creating an OVA image, which I then attempt to import to AWS.
The first time I attempted this I got the dreaded "Unsupported kernel version..." error.

Therefore, I launched this AMI: ubuntu/images-testing/hvm-ssd/ubuntu-bionic-daily-amd64-server-20180912 (ami-00cc0fe8bda132f03)
Then I logged in and I checked (uname -a) which kernel was running:

Linux ip-172-31-42-89 4.15.0-1021-aws #21-Ubuntu SMP Tue Aug 28 10:23:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

So I changed the kernel to 4.15.0-1021-aws and then I got:
Post-processor failed: Import task import-ami-0a70505000abf192c failed: ClientError: Unsupported kernel version 4.15.0-1021-aws

The two kernel versions are exactly the same...

Any idea of what the cause could be?

Thanks!

G

Rickard von Essen

unread,
Sep 15, 2018, 5:24:57 AM9/15/18
to packe...@googlegroups.com
Could you share your template?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/edbc2e32-bb40-4795-b2b4-7dbd1bd7cce3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giovanni Vigna

unread,
Sep 17, 2018, 12:10:41 PM9/17/18
to packe...@googlegroups.com
Here is the file that I am using...

{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
"aws_region": "{{env `AWS_REGION`}}",
"aws_bucket": "{{env `AWS_BUCKET`}}"
},
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/ansible.sh"
},
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/setup.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/main.yml",
"galaxy_file": "requirements.yml"
},
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/cleanup.sh"
}
],
"builders": [
{
"type": "virtualbox-iso",
"output_directory": "builds",
"format": "ova",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=vagrant<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 81920,
"guest_os_type": "Ubuntu_64",
"headless": false,
"http_directory": "http",
"iso_urls": [
"../iso/ubuntu-18.04.1-server-amd64.iso",
"http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04.1-server-amd64.iso"
],
"iso_checksum_type": "sha256",
"iso_checksum": "a5b0ea5918f850124f3d72ef4b85bda82f0fcd02ec721be19c1a6952791c8ee8",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-ubuntu-18.04-amd64",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"1024"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
]
}
],
"post-processors": [
{
"type": "amazon-import",
"keep_input_artifact": true,
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"s3_bucket_name": "{{user `aws_bucket`}}",
"license_type": "BYOL",
"tags": {
"Description": "packer amazon import "
}
},
{
"type": "vagrant",
"keep_input_artifact": true,
"output": "builds/{{.Provider}}-ubuntu1804.box"
}
]
> To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt9vHk6jxU6FQZo9bRFNkzNEKGYM5J4DjL4rDgwCK2MN8A%40mail.gmail.com.

Rickard von Essen

unread,
Sep 17, 2018, 3:18:01 PM9/17/18
to packe...@googlegroups.com
Could you also provide the preseed and at least relevant scripts. 

Giovanni Vigna

unread,
Sep 18, 2018, 12:35:57 PM9/18/18
to packe...@googlegroups.com
This is the preseed and the other files:

preseed.cfg
setup.sh
cleanup.sh
ansible.sh
requirements.yml
main.yml

Rickard von Essen

unread,
Sep 19, 2018, 4:25:38 PM9/19/18
to packe...@googlegroups.com
I can confirm that I get the same problem with your config. One strange thing is that the format when doing a Describe-import-task is vmdk, so I patched Packer to explicitly tell aws that it's a ova, but it still says vmdk.

Have to dig some more. 

On Tue, Sep 18, 2018, 18:35 Giovanni Vigna <vi...@ucsb.edu> wrote:
This is the preseed and the other files:

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Any help is greatly appreciated.

G

> For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Sep 20, 2018, 5:41:10 AM9/20/18
to packe...@googlegroups.com
I have opened an issue for this:
Reply all
Reply to author
Forward
0 new messages