Trying create HVM instance-store image on Ubuntu Xenial (16.04) but have issue with 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.
--
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.
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"]
}
]
}
{
"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"
}
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.
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.
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.
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.
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.
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.
LABEL=UEFI /boot/efi vfat defaults 0 0
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.
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.
Partition type:mbr,gpt, ornone. For Ubuntu 14.04 and later HVM instances, add the--partition mbrflag to bundle the boot instructions properly; otherwise, your newly-created AMI will not boot.
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.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c9e1a3ac-2c4a-468d-9942-6c1689d98a8a%40googlegroups.com.
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 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.