AWS AMI Ubuntu Xenial (16.04) HVM instance-store image - grub issue

1,129 views
Skip to first unread message

Oleg Galitskiy

unread,
Oct 27, 2016, 9:27:16 AM10/27/16
to Packer

Trying create HVM instance-store image on Ubuntu Xenial (16.04) but have issue with grub:




I see that used legacy grub:
==> amazon-instance: Bundling the volume...
    amazon
-instance: sudo: unable to resolve host ip-10-0-0-114
    amazon
-instance: mesg: ttyname failed: Inappropriate ioctl for device
    amazon
-instance: Setting partition type to bundle "/" with...
    amazon
-instance: Auto-detecting partition type for "/"
    amazon
-instance: Partition label detected using parted: "gpt"
    amazon
-instance: Using partition type "gpt"
    amazon
-instance: Copying / into the image file /tmp/image-1477573242...
    amazon
-instance: Excluding:
    amazon
-instance: /sys
    amazon-instance: /
proc
    amazon
-instance: /dev
    amazon-instance: /
dev/pts
    amazon
-instance: /sys/kernel/security
    amazon
-instance: /sys/fs/cgroup/systemd
    amazon
-instance: /sys/fs/pstore
    amazon
-instance: /sys/fs/cgroup/net_cls,net_prio
    amazon
-instance: /sys/fs/cgroup/hugetlb
    amazon
-instance: /sys/fs/cgroup/freezer
    amazon
-instance: /sys/fs/cgroup/memory
    amazon
-instance: /sys/fs/cgroup/pids
    amazon
-instance: /sys/fs/cgroup/cpuset
    amazon
-instance: /sys/fs/cgroup/cpu,cpuacct
    amazon
-instance: /sys/fs/cgroup/blkio
    amazon
-instance: /sys/fs/cgroup/devices
    amazon
-instance: /sys/fs/cgroup/perf_event
    amazon
-instance: /proc/sys/fs/binfmt_misc
    amazon
-instance: /dev/mqueue
    amazon
-instance: /dev/hugepages
    amazon
-instance: /sys/kernel/debug
    amazon
-instance: /sys/fs/fuse/connections
    amazon
-instance: /boot/efi
    amazon
-instance: /var/lib/lxcfs
    amazon
-instance: /dev
    amazon-instance: /
media
    amazon
-instance: /mnt
    amazon-instance: /
proc
    amazon
-instance: /sys
    amazon-instance: /
tmp/cert.pem
    amazon
-instance: /tmp/image-1477573242
    amazon
-instance: /mnt/img-mnt
    amazon
-instance: Installing GRUB on root device with gpt boot scheme
    amazon
-instance: Using default grub config
    amazon
-instance: Found the following differences between your kernel commandline and the grub configuration on the volume:
    amazon
-instance: * Missing key 'BOOT_IMAGE' with value '/boot/vmlinuz-4.4.0-45-generic'
    amazon
-instance: * Key 'root' value 'UUID=d4f38234-07cf-4037-b891-ef99bd159b8a' differs from /proc/cmdline value 'LABEL=cloudimg-rootfs'
    amazon
-instance: * Missing key 'console' with value 'ttyS0'
    amazon
-instance: Please verify that the kernel command line in /mnt/img-mnt/boot/grub/menu.lst is correct for your new AMI.
    amazon
-instance: Adjusting /mnt/img-mnt/boot/grub/menu.lst
    amazon
-instance: # menu.lst - See: grub(8), info grub, update-grub(8)
    amazon
-instance: #            grub-install(8), grub-floppy(8),
    amazon
-instance: #            grub-md5-crypt, /usr/share/doc/grub
    amazon
-instance: #            and /usr/share/doc/grub-legacy-doc/.
    amazon
-instance:
    amazon
-instance: ## default num
    amazon
-instance: # Set the default entry to the entry number NUM. Numbering starts from 0, and
    amazon
-instance: # the entry number 0 is the default if the command is not used.
    amazon
-instance: #
    amazon
-instance: # You can specify 'saved' instead of a number. In this case, the default entry
    amazon
-instance: # is the entry saved with the command 'savedefault'.
    amazon
-instance: # WARNING: If you are using dmraid do not use 'savedefault' or your
    amazon
-instance: # array will desync and will not let you boot your system.
    amazon
-instance: default        0
    amazon
-instance:
    amazon
-instance: ## timeout sec
    amazon
-instance: # Set a timeout, in SEC seconds, before automatically booting the default entry
    amazon
-instance: # (normally the first entry defined).
    amazon
-instance: timeout        3
    amazon
-instance:
    amazon
-instance: ## hiddenmenu
    amazon
-instance: # Hides the menu by default (press ESC to see the menu)
    amazon
-instance: hiddenmenu
    amazon
-instance:
    amazon
-instance: # Pretty colours
    amazon
-instance: #color cyan/blue white/blue
    amazon
-instance:
    amazon
-instance: ## password ['--md5'] passwd
    amazon
-instance: # If used in the first section of a menu file, disable all interactive editing
    amazon
-instance: # control (menu entry editor and command-line)  and entries protected by the
    amazon
-instance: # command 'lock'
    amazon
-instance: # e.g. password topsecret
    amazon
-instance: #      password --md5 $1$gLhU0/$aW78kgkyjhlnUoe/
    amazon
-instance: # password topsecret
    amazon
-instance:
    amazon
-instance: #
    amazon
-instance: # examples
    amazon
-instance: #
    amazon
-instance: # title        Windows 95/98/NT/2000
    amazon
-instance: # root        (hd0,0)
    amazon
-instance: # makeactive
    amazon
-instance: # chainloader    +1
    amazon
-instance: #
    amazon
-instance: # title        Linux
    amazon
-instance: # root        (hd0,1)
    amazon
-instance: # kernel    /vmlinuz root=/dev/hda2 ro
    amazon
-instance: #
    amazon
-instance:
    amazon
-instance: #
    amazon
-instance: # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    amazon
-instance:
    amazon
-instance: ### BEGIN AUTOMAGIC KERNELS LIST
    amazon
-instance: ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    amazon
-instance: ## by the debian update-grub script except for the default options below
    amazon
-instance:
    amazon
-instance: ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    amazon
-instance:
    amazon
-instance: ## ## Start Default Options ##
    amazon
-instance: ## default kernel options
    amazon
-instance: ## default kernel options for automagic boot options
    amazon
-instance: ## If you want special options for specific kernels use kopt_x_y_z
    amazon
-instance: ## where x.y.z is kernel version. Minor versions can be omitted.
    amazon
-instance: ## e.g. kopt=root=/dev/hda1 ro
    amazon
-instance: ##      kopt_2_6_8=root=/dev/hdc1 ro
    amazon
-instance: ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    amazon
-instance: # kopt=root=UUID=d4f38234-07cf-4037-b891-ef99bd159b8a ro
    amazon
-instance:
    amazon
-instance: ## default grub root device
    amazon
-instance: ## e.g. groot=(hd0,0)
    amazon
-instance: # groot=(hd0,0)
    amazon
-instance:
    amazon
-instance: ## should update-grub create alternative automagic boot options
    amazon
-instance: ## e.g. alternative=true
    amazon
-instance: ##      alternative=false
    amazon
-instance: # alternative=true
    amazon
-instance:
    amazon
-instance: ## should update-grub lock alternative automagic boot options
    amazon
-instance: ## e.g. lockalternative=true
    amazon
-instance: ##      lockalternative=false
    amazon
-instance: # lockalternative=false
    amazon
-instance:
    amazon
-instance: ## additional options to use with the default boot option, but not with the
    amazon
-instance: ## alternatives
    amazon
-instance: ## e.g. defoptions=vga=791 resume=/dev/hda5
    amazon
-instance: # defoptions=quiet splash
    amazon
-instance:
    amazon
-instance: ## should update-grub lock old automagic boot options
    amazon
-instance: ## e.g. lockold=false
    amazon
-instance: ##      lockold=true
    amazon
-instance: # lockold=false
    amazon
-instance:
    amazon
-instance: ## Xen hypervisor options to use with the default Xen boot option
    amazon
-instance: # xenhopt=
    amazon
-instance:
    amazon
-instance: ## Xen Linux kernel options to use with the default Xen boot option
    amazon
-instance: # xenkopt=console=tty0
    amazon
-instance:
    amazon
-instance: ## altoption boot targets option
    amazon
-instance: ## multiple altoptions lines are allowed
    amazon
-instance: ## e.g. altoptions=(extra menu suffix) extra boot options
    amazon
-instance: ##      altoptions=(recovery) single
    amazon
-instance: # altoptions=(recovery mode) single
    amazon
-instance:
    amazon
-instance: ## controls how many kernels should be put into the menu.lst
    amazon
-instance: ## only counts the first occurence of a kernel, not the
    amazon
-instance: ## alternative kernel options
    amazon
-instance: ## e.g. howmany=all
    amazon
-instance: ##      howmany=7
    amazon
-instance: # howmany=all
    amazon
-instance:
    amazon
-instance: ## specify if running in Xen domU or have grub detect automatically
    amazon
-instance: ## update-grub will ignore non-xen kernels when running in domU and vice versa
    amazon
-instance: ## e.g. indomU=detect
    amazon
-instance: ##      indomU=true
    amazon
-instance: ##      indomU=false
    amazon
-instance: # indomU=detect
    amazon
-instance:
    amazon
-instance: ## should update-grub create memtest86 boot option
    amazon
-instance: ## e.g. memtest86=true
    amazon
-instance: ##      memtest86=false
    amazon
-instance: # memtest86=true
    amazon
-instance:
    amazon
-instance: ## should update-grub adjust the value of the default booted system
    amazon
-instance: ## can be true or false
    amazon
-instance: # updatedefaultentry=false
    amazon
-instance:
    amazon
-instance: ## should update-grub add savedefault to the default options
    amazon
-instance: ## can be true or false
    amazon
-instance: # savedefault=false
    amazon
-instance:
    amazon
-instance: ## ## End Default Options ##
    amazon
-instance:
    amazon
-instance: title        Ubuntu 16.04.1 LTS, kernel 4.4.0-45-generic
    amazon
-instance: root        (hd0,0)
    amazon
-instance: kernel        /boot/vmlinuz-4.4.0-45-generic root=UUID=d4f38234-07cf-4037-b891-ef99bd159b8a ro quiet splash
    amazon
-instance: initrd        /boot/initrd.img-4.4.0-45-generic
    amazon
-instance:
    amazon
-instance: title        Ubuntu 16.04.1 LTS, kernel 4.4.0-45-generic (recovery mode)
    amazon
-instance: root        (hd0,0)
    amazon
-instance: kernel        /boot/vmlinuz-4.4.0-45-generic root=UUID=d4f38234-07cf-4037-b891-ef99bd159b8a ro  single
    amazon
-instance: initrd        /boot/initrd.img-4.4.0-45-generic
    amazon
-instance:
    amazon
-instance: ### END DEBIAN AUTOMAGIC KERNELS LIST
    amazon
-instance: Image file created: /tmp/image-1477573242
    amazon
-instance: Volume cloning done.
    amazon
-instance: Bundling image file...
    amazon
-instance: Splitting /tmp/image-1477573242.tar.gz.enc...
    amazon
-instance: Created image-1477573242.part.00
    amazon
-instance: Created image-1477573242.part.01
    amazon
-instance: Created image-1477573242.part.02
    amazon
-instance: Created image-1477573242.part.03
    amazon
-instance: Created image-1477573242.part.04
    amazon
-instance: Created image-1477573242.part.05
    amazon
-instance: Created image-1477573242.part.06
    amazon
-instance: Created image-1477573242.part.07
    amazon
-instance: Created image-1477573242.part.08
    amazon
-instance: Created image-1477573242.part.09
    amazon
-instance: Created image-1477573242.part.10
    amazon
-instance: Created image-1477573242.part.11
    amazon
-instance: Created image-1477573242.part.12
    amazon
-instance: Created image-1477573242.part.13
    amazon
-instance: Created image-1477573242.part.14
    amazon
-instance: Created image-1477573242.part.15
    amazon
-instance: Created image-1477573242.part.16
    amazon
-instance: Created image-1477573242.part.17
    amazon
-instance: Created image-1477573242.part.18
    amazon
-instance: Created image-1477573242.part.19
    amazon
-instance: Created image-1477573242.part.20
    amazon
-instance: Created image-1477573242.part.21
    amazon
-instance: Created image-1477573242.part.22
    amazon
-instance: Created image-1477573242.part.23
    amazon
-instance: Created image-1477573242.part.24
    amazon
-instance: Created image-1477573242.part.25
    amazon
-instance: Created image-1477573242.part.26
    amazon
-instance: Created image-1477573242.part.27
    amazon
-instance: Created image-1477573242.part.28
    amazon
-instance: Created image-1477573242.part.29
    amazon
-instance: Created image-1477573242.part.30
    amazon
-instance: Created image-1477573242.part.31
    amazon
-instance: Created image-1477573242.part.32
    amazon
-instance: Created image-1477573242.part.33
    amazon
-instance: Created image-1477573242.part.34
    amazon
-instance: Created image-1477573242.part.35
    amazon
-instance: Created image-1477573242.part.36
    amazon
-instance: Generating digests for each part...
    amazon
-instance: Digests generated.
    amazon
-instance: Unable to read instance meta-data for ancestor-ami-ids
    amazon
-instance: Unable to read instance meta-data for kernel-id
    amazon
-instance: Unable to read instance meta-data for ramdisk-id
    amazon
-instance: Unable to read instance meta-data for product-codes
    amazon
-instance: Creating bundle manifest...
    amazon
-instance: Bundle manifest is /tmp/image-1477573242.manifest.xml
    amazon
-instance: ec2-bundle-vol complete.

but should be used grub2 for Ubuntu 16.

P.S. with instance-ebs there're issues.

packer version: 0.11.0
host: MacOS 10.11.6 64bit

Thanks.


Rickard von Essen

unread,
Oct 27, 2016, 3:59:45 PM10/27/16
to packe...@googlegroups.com
Please supply a template and scripts with a minimal reproducible case and it will be quicker to help.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/dc5763bd-6b48-4e7f-8939-336184494bea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oleg Galitskiy

unread,
Oct 27, 2016, 5:14:50 PM10/27/16
to Packer
Template (template-xenial-x86_64.json):
{
 
"variables": {
   
"stage": "unstable",
   
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
   
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
   
"aws_account_id": "{{env `AWS_ACCOUNT_ID`}}",
   
"aws_region": "{{env `AWS_REGION`}}",
   
"aws_source_ami": "{{env `AWS_SOURCE_AMI`}}",
   
"aws_virtualization_type": "{{env `AWS_VIRT_TYPE`}}",
   
"aws_instance_type": "{{env `AWS_INSTANCE_TYPE`}}",
   
"aws_ami_suffix": "{{env `AWS_AMI_NAME_SUFFIX`}}",
   
"aws_subnet_id": "{{env `AWS_SUBNET_ID`}}",
   
"aws_vpc_id": "{{env `AWS_VPC_ID`}}",
   
"aws_security_group_id": "{{env `AWS_SECURITY_GROUP_ID`}}",
   
"aws_availability_zone": "{{env `AWS_AVAILABILITY_ZONE`}}",
   
"aws_iam_instance_profile": "{{env `AWS_IAM_INSTANCE_PROFILE`}}",
   
"ssh_login": "{{env `SSH_USERNAME`}}",
   
"x509_cert_path": null,
   
"x509_key_path": null
 
},
 
"builders": [
   
{
     
"type": "amazon-instance",
     
"access_key": "{{user `aws_access_key`}}",
     
"secret_key": "{{user `aws_secret_key`}}",
     
"account_id": "{{user `aws_account_id`}}",
     
"region": "{{user `aws_region`}}",
     
"s3_bucket": "{{user `aws_region`}}-amis",
     
"source_ami": "{{user `aws_source_ami` }}",
     
"instance_type": "{{user `aws_instance_type`}}",
     
"ssh_username": "{{user `ssh_login`}}",
     
"ami_name": "ubuntu-{{user `ubuntu_release`}}-x86_64-{{user `aws_virtualization_type`}}",
     
"ami_virtualization_type": "{{user `aws_virtualization_type`}}",
     
"x509_cert_path": "{{user `x509_cert_path`}}",
     
"x509_key_path": "{{user `x509_key_path`}}",
     
"associate_public_ip_address": true,
     
"subnet_id": "{{user `aws_subnet_id`}}",
     
"vpc_id": "{{user `aws_vpc_id`}}",
     
"security_group_id": "{{user `aws_security_group_id`}}",
     
"availability_zone": "{{user `aws_availability_zone`}}",
     
"iam_instance_profile": "{{user `aws_iam_instance_profile`}}",
     
"enhanced_networking": "false",
     
"ssh_keypair_name": "packer",
     
"ssh_private_key_file": "keys/packer"
   
}
 
],
 
"provisioners": [
   
{
     
"type": "shell",
     
"pause_before": "3s",
     
"inline": [
       
"export DEBIAN_FRONTEND=noninteractive",
       
"sudo -E apt-get check -m -y ; sudo -E apt-get update;",
       
"sudo apt-get install kpartx zip grub ruby2.3 -y > /dev/null",
       
"wget --quiet http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip",
       
"unzip -qq ec2-ami-tools.zip",
       
"sudo rsync -a --no-o --no-g ec2-ami-tools-*/ /usr/local/"
     
],
     
"environment_vars": [ "REGION={{user `aws_region`}}" ],
     
"only": ["amazon-instance"]
   
}
 
]
}


Variables (aws_xenial_hvm_instance_us-east-1_test.json):
{
 
"stage": "testami",
 
"aws_access_key": "my_key",
 
"aws_secret_key": "my_secret",
 
"aws_account_id": "111-22-3-4-6-77",
 
"aws_region": "us-east-1",
 
"aws_source_ami": "ami-3fabf828",
 
"aws_virtualization_type": "hvm",
 
"aws_instance_type": "c3.large",
 
"aws_subnet_id": "subnet-1234567",
 
"aws_vpc_id": "vpc-1234567",
 
"ssh_login": "user1",
 
"ubuntu_release": "xenial",
 
"x509_cert_path": "aws-x509.pem",
 
"x509_key_path": "aws-key.pem"
}

Command:
packer build -only=amazon-instance -var-file=aws_xenial_hvm_instance_us-east-1_test.json template-xenial-x86_64.json
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Oct 30, 2016, 1:03:43 PM10/30/16
to packe...@googlegroups.com
In your provisioning I would definitely drop installation of grub, there is no reason to install it unless it's already there.

To troubleshoot this run with -on-error=ask and when it fail ssh into the instance and manually run the bundling commands until you find what's wrong and what works.

For reference this template works with 14.04, 16.04, and 16.10 (ami-3b81275a, ami-d17836a2, and ami-cd87c9be):

{
  "variables": {
    "aws_source_ami": "ami-86307ef5",
    "private_key": "",
    "keypair": "",
    "bundle_key_id": null,
    "bundle_secret_key": null,
    "s3_bucket": null,
    "account_id": null,
    "home": "{{ env `HOME` }}"
  },
  "builders": [
    {
      "type": "amazon-instance",
      "region": "eu-west-1",
      "account_id": "{{ user `account_id` }}",
      "source_ami": "{{ user `aws_source_ami` }}",
      "instance_type": "m3.medium",
      "ssh_username": "ubuntu",
      "ssh_keypair_name": "{{ user `keypair` }}",
      "ssh_private_key_file": "{{ user `private_key` }}",
      "ssh_pty": "true",
      "ami_name": "packer-demo-{{timestamp}}",
      "s3_bucket": "{{ user `s3_bucket` }}",
      "x509_cert_path": "{{ user `home` }}/.aws/certificate.pem",
      "x509_key_path": "{{ user `home` }}/.aws/private-key.pem",
      "bundle_destination": "/mnt/tmp/",
      "bundle_upload_command": "sudo -i -n ec2-upload-bundle -b {{.BucketName}} -m {{.ManifestPath}} -a {{ user `bundle_key_id` }} -s {{ user `bundle_secret_key` }} -d {{.BundleDirectory}} --batch --retry "
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "pause_before": "5s",
      "inline": [
        "sudo mkdir -p /mnt/tmp",
        "sudo apt-get update",
        "sudo apt-get install -y ec2-ami-tools"
      ]
    }
  ]
}

// Rickard

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/dc4bd020-6051-4431-ac72-072e22805e80%40googlegroups.com.

Oleg Galitskiy

unread,
Oct 31, 2016, 9:59:17 AM10/31/16
to Packer
No luck :(

Tried with your template but with source AMI ami-3fabf828 (for us-east-1).


Rickard von Essen

unread,
Oct 31, 2016, 10:05:43 AM10/31/16
to packe...@googlegroups.com
Where is that screenshot from? AWS doesn't run qemu?

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/2674c7fe-cbab-418f-badf-0647a8a12682%40googlegroups.com.

Oleg Galitskiy

unread,
Oct 31, 2016, 10:10:00 AM10/31/16
to Packer

On screenshot I see that "No bootable device"

Oleg Galitskiy

unread,
Oct 31, 2016, 10:19:47 AM10/31/16
to Packer
Screenshot from AWS: Actions -> instance Settings -> Get Instance Screenshot.

Oleg Galitskiy

unread,
Oct 31, 2016, 10:52:32 AM10/31/16
to Packer
Could you show me your output of "Bundling the volume" in debug mode?

Thanks.

Rickard von Essen

unread,
Oct 31, 2016, 10:53:16 AM10/31/16
to packe...@googlegroups.com
I just realized that with 16.04 I the ami doesn't boot, and I get the following log:
md: ... autorun DONE.
EXT3-fs: sda1: couldn't mount because of unsupported optional features (240).
EXT2-fs: sda1: couldn't mount because of unsupported optional features (240).
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)

It works fine with 16.10. I'll try and upgrade ec2-ami-tools, the one you get with ubuntu from the repos are 1.4.0, and is super old.

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/43b87129-aaf5-456a-a87f-b9019bc9d5bd%40googlegroups.com.

Rickard von Essen

unread,
Oct 31, 2016, 10:54:40 AM10/31/16
to packe...@googlegroups.com
==> amazon-instance: Bundling the volume...
    amazon-instance: Copying / into the image file /mnt/tmp/image-1477924895...
    amazon-instance: Excluding:
    amazon-instance: /sys
    amazon-instance: /proc
    amazon-instance: /dev
    amazon-instance: /dev/pts
    amazon-instance: /
    amazon-instance: /sys/kernel/security
    amazon-instance: /sys/fs/cgroup/systemd
    amazon-instance: /sys/fs/pstore
    amazon-instance: /sys/fs/cgroup/freezer
    amazon-instance: /sys/fs/cgroup/hugetlb
    amazon-instance: /sys/fs/cgroup/cpuset
    amazon-instance: /sys/fs/cgroup/net_cls,net_prio
    amazon-instance: /sys/fs/cgroup/blkio
    amazon-instance: /sys/fs/cgroup/devices
    amazon-instance: /sys/fs/cgroup/memory
    amazon-instance: /sys/fs/cgroup/cpu,cpuacct
    amazon-instance: /sys/fs/cgroup/perf_event
    amazon-instance: /sys/fs/cgroup/pids
    amazon-instance: /proc/sys/fs/binfmt_misc
    amazon-instance: /dev/hugepages
    amazon-instance: /dev/mqueue
    amazon-instance: /sys/kernel/debug
    amazon-instance: /sys/fs/fuse/connections
    amazon-instance: /boot/efi
    amazon-instance: /var/lib/lxcfs
    amazon-instance: /dev
    amazon-instance: /media
    amazon-instance: /mnt
    amazon-instance: /proc
    amazon-instance: /sys
    amazon-instance: /etc/udev/rules.d/70-persistent-net.rules
    amazon-instance: /etc/udev/rules.d/z25_persistent-net.rules
    amazon-instance: /tmp/cert.pem
    amazon-instance: /mnt/tmp/image-1477924895
    amazon-instance: /mnt/img-mnt
    amazon-instance: 1+0 records in
    amazon-instance: 1+0 records out
    amazon-instance: 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00176716 s, 593 MB/s
    amazon-instance: mke2fs 1.42.13 (17-May-2015)
    amazon-instance: Bundling image file...
    amazon-instance: Splitting /mnt/tmp/image-1477924895.tar.gz.enc...
    amazon-instance: Created image-1477924895.part.00
    amazon-instance: Created image-1477924895.part.01
    amazon-instance: Created image-1477924895.part.02
    amazon-instance: Created image-1477924895.part.03
    amazon-instance: Created image-1477924895.part.04
    amazon-instance: Created image-1477924895.part.05
    amazon-instance: Created image-1477924895.part.06
    amazon-instance: Created image-1477924895.part.07
    amazon-instance: Created image-1477924895.part.08
    amazon-instance: Created image-1477924895.part.09
    amazon-instance: Created image-1477924895.part.10
    amazon-instance: Created image-1477924895.part.11
    amazon-instance: Created image-1477924895.part.12
    amazon-instance: Created image-1477924895.part.13
    amazon-instance: Created image-1477924895.part.14
    amazon-instance: Created image-1477924895.part.15
    amazon-instance: Created image-1477924895.part.16
    amazon-instance: Created image-1477924895.part.17
    amazon-instance: Created image-1477924895.part.18
    amazon-instance: Created image-1477924895.part.19
    amazon-instance: Created image-1477924895.part.20
    amazon-instance: Created image-1477924895.part.21
    amazon-instance: Created image-1477924895.part.22
    amazon-instance: Created image-1477924895.part.23
    amazon-instance: Created image-1477924895.part.24
    amazon-instance: Created image-1477924895.part.25
    amazon-instance: Created image-1477924895.part.26
    amazon-instance: Created image-1477924895.part.27
    amazon-instance: Created image-1477924895.part.28
    amazon-instance: Created image-1477924895.part.29
    amazon-instance: Created image-1477924895.part.30
    amazon-instance: Created image-1477924895.part.31
    amazon-instance: Generating digests for each part...
    amazon-instance: Digests generated.
    amazon-instance: Unable to read instance meta-data for ancestor-ami-ids
    amazon-instance: Unable to read instance meta-data for kernel-id
    amazon-instance: Unable to read instance meta-data for ramdisk-id
    amazon-instance: Unable to read instance meta-data for product-codes
    amazon-instance: Creating bundle manifest...
    amazon-instance: ec2-bundle-vol complete.
==> amazon-instance: Uploading the bundle...
    amazon-instance: Uploading bundled image parts to the S3 bucket rickard-von-essen-packer ...
    amazon-instance: Uploaded image-1477924895.part.00
    amazon-instance: Uploaded image-1477924895.part.01
    amazon-instance: Uploaded image-1477924895.part.02
    amazon-instance: Uploaded image-1477924895.part.03
    amazon-instance: Uploaded image-1477924895.part.04
    amazon-instance: Uploaded image-1477924895.part.05
    amazon-instance: Uploaded image-1477924895.part.06
    amazon-instance: Uploaded image-1477924895.part.07
    amazon-instance: Uploaded image-1477924895.part.08
    amazon-instance: Uploaded image-1477924895.part.09
    amazon-instance: Uploaded image-1477924895.part.10
    amazon-instance: Uploaded image-1477924895.part.11
    amazon-instance: Uploaded image-1477924895.part.12
    amazon-instance: Uploaded image-1477924895.part.13
    amazon-instance: Uploaded image-1477924895.part.14
    amazon-instance: Uploaded image-1477924895.part.15
    amazon-instance: Uploaded image-1477924895.part.16
    amazon-instance: Uploaded image-1477924895.part.17
    amazon-instance: Uploaded image-1477924895.part.18
    amazon-instance: Uploaded image-1477924895.part.19
    amazon-instance: Uploaded image-1477924895.part.20
    amazon-instance: Uploaded image-1477924895.part.21
    amazon-instance: Uploaded image-1477924895.part.22
    amazon-instance: Uploaded image-1477924895.part.23
    amazon-instance: Uploaded image-1477924895.part.24
    amazon-instance: Uploaded image-1477924895.part.25
    amazon-instance: Uploaded image-1477924895.part.26
    amazon-instance: Uploaded image-1477924895.part.27
    amazon-instance: Uploaded image-1477924895.part.28
    amazon-instance: Uploaded image-1477924895.part.29
    amazon-instance: Uploaded image-1477924895.part.30
    amazon-instance: Uploaded image-1477924895.part.31
    amazon-instance: Uploading manifest ...
    amazon-instance: Uploaded manifest.
    amazon-instance: Bundle upload completed.


To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/33bf0570-43ef-45e1-915e-75a579cd5419%40googlegroups.com.

Oleg Galitskiy

unread,
Oct 31, 2016, 11:01:20 AM10/31/16
to Packer
The latest 'ec2-ami-tools' required grub.

Rickard von Essen

unread,
Nov 1, 2016, 4:08:20 AM11/1/16
to packe...@googlegroups.com
I've been digin a bit deeper into this. A few notes:

paravirtual: should install grub-legacy-ec2
hvm: should install grub

ec2-ami-tools from the ubuntu repos are super old, install from AWS provided zip.

Building and booting 16.04 pv instances works fine. I'm starting to think that the warnings about a incorrect grub config is actually a "bug" (misconfiguration) in the stock ubuntu AMI's for 16.04.

I'll try to compare them with 16.10 and 15.10 (if that works) and file a bug-report with ubuntu if I find what's wrong.

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d28c262e-b9d5-4f84-af85-332138869ee8%40googlegroups.com.

Oleg Galitskiy

unread,
Nov 1, 2016, 5:48:11 AM11/1/16
to Packer
Yes, this is definitely issue with grub. Today I have luck built working instance-store AMI on Ubuntu 16.04, but with manual manipulations with grub. I'll try to do it with packer and will post here how I did it.

Oleg Galitskiy

unread,
Nov 1, 2016, 9:07:00 AM11/1/16
to Packer
Found solution.
Source AMI used efi bootloader. I don't know if ec2-bundle-vol can work with efi bootloader (didn't find solution in this way), therefore, I changed bootloader to gpt.
For that, I removed from fstab:
LABEL=UEFI    /boot/efi    vfat    defaults    0 0

and added "--grub-config /boot/grub/menu.lst" into bundle_vol_command, after these changes AMI built successfully.

Rickard von Essen

unread,
Nov 1, 2016, 9:12:52 AM11/1/16
to packe...@googlegroups.com
Awesome, it would be interesting to compare this with 16.10.

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/40177af1-42d8-44f2-829f-3e65416ed1e0%40googlegroups.com.

Apollo Catlin

unread,
Dec 23, 2016, 5:18:09 PM12/23/16
to Packer
This 100% does not work for me with any of the last few official ubuntu ami's. Are there other steps you have taken since?

Rickard von Essen

unread,
Dec 24, 2016, 7:43:14 AM12/24/16
to packe...@googlegroups.com
Unfortunately I had no time digging into this further. 

It would be interesting to compare the /boot/grub/menu.lst from AMI's for 15.10, 16.04, and 16.10. 16.04 was the only one broken.

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/f259daac-e44b-4602-81be-7c454572b71b%40googlegroups.com.

Bimlendu Mishra

unread,
Feb 8, 2017, 7:02:15 AM2/8/17
to Packer
For me the solution was using '--partition mbr' flag in ec2-bundle-vol command, as stated here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-instance-store-ami.html#ubuntu_instructions

Partition type: mbrgpt, or none. For Ubuntu 14.04 and later HVM instances, add the--partition mbr flag to bundle the boot instructions properly; otherwise, your newly-created AMI will not boot.

Bruce Edge

unread,
May 22, 2017, 10:11:30 PM5/22/17
to Packer
Confirming this is still a problem with 20170516 images.

Rickard von Essen

unread,
May 23, 2017, 12:13:59 AM5/23/17
to packe...@googlegroups.com
Did you try the partition mbr option? 

On May 23, 2017 04:11, "Bruce Edge" <bruce...@gmail.com> wrote:
Confirming this is still a problem with 20170516 images.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c9e1a3ac-2c4a-468d-9942-6c1689d98a8a%40googlegroups.com.

Bruce Edge

unread,
May 23, 2017, 11:59:38 AM5/23/17
to packe...@googlegroups.com

I'm not building my own AMIs.

I'm using the pre-build Ubuntu images from https://cloud-images.ubuntu.com/locator/

 

I started this thread on the Ubuntu cloud forum. https://ubuntuforums.org/showthread.php?t=2362043&p=13648371#post13648371, as this feels like a problem in their AMI build process.

 

 

-Bruce

 

From: "packe...@googlegroups.com" <packe...@googlegroups.com> on behalf of Rickard von Essen <rickard....@gmail.com>
Reply-To: "packe...@googlegroups.com" <packe...@googlegroups.com>
Date: Monday, May 22, 2017 at 9:13 PM
To: "packe...@googlegroups.com" <packe...@googlegroups.com>
Subject: Re: [packer] Re: AWS AMI Ubuntu Xenial (16.04) HVM instance-store image - grub issue

 

Did you try the partition mbr option? 

On May 23, 2017 04:11, "Bruce Edge" <bruce...@gmail.com> wrote:

Confirming this is still a problem with 20170516 images.

--
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.

--

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 a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/e1CVNAbDxQI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt-BEp0iwU7x7j9Q3V7Q-HgcSUr8h1riG4S6rLL_TanJ4g%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages