You can't set encrypted to true to a existing device. Try remove that and I guess it should work. If you want to encrypt it use encrypt_boot: true.
On 18 August 2017 at 13:43, <[email protected]> wrote: > Hi Rickard, > > Thanks for the response, that helps make the distinction clear. What I'm > still blocked on is getting the root vol to be increased. > > The source image boots from /dev/xvda(1). When I specify /dev/xvda as the > device in ami_block_device_mappings > > This builder config: > > "builders": [{ > > "type": "amazon-ebs", > "communicator": "ssh", > "ssh_pty": "true", > "access_key": "{{user `aws_access_key`}}", > "secret_key": "{{user `aws_secret_key`}}", > "region": "eu-west-1", > "source_ami": "ami-88e60ff1", > "instance_type": "t2.nano", > "ssh_username": "admin", > "ami_name": "jenkins-slave-stretch{{timestamp}}", > "encrypt_boot": true, > "ami_block_device_mappings": [ { > "device_name": "/dev/xvda", > "volume_size": 42, > "volume_type": "gp2", > "encrypted": true, > "delete_on_termination": true > } ] > }], > > It fails with the error: > > Error creating AMI: InvalidBlockDeviceMapping: The device 'xvda' is used > in more than one block-device mapping > > > > If I specify a different device id then I end up with an additional disk > on the image: > > > This builder config: > > > > "builders": [{ > > "type": "amazon-ebs", > "communicator": "ssh", > "ssh_pty": "true", > "access_key": "{{user `aws_access_key`}}", > "secret_key": "{{user `aws_secret_key`}}", > "region": "eu-west-1", > "source_ami": "ami-88e60ff1", > "instance_type": "t2.nano", > "ssh_username": "admin", > "ami_name": "jenkins-slave-stretch{{timestamp}}", > "encrypt_boot": true, > "ami_block_device_mappings": [ { > "device_name": "/dev/xvdb", > "volume_size": 42, > "volume_type": "gp2", > "encrypted": true, > "delete_on_termination": true > } ] > }], > > > > > > Ends up like this: > > > > > <https://lh3.googleusercontent.com/-OT3hgV71Yss/WZbMNPDGB8I/AAAAAAAAAAM/x33FVVEfRXYnK1cvKo_8oy039ZLgWGfUgCLcBGAs/s1600/Screen%2BShot%2B2017-08-18%2Bat%2B11.53.49.png> > > > > > > > > > > > > > > So I've so-far failed to extend the root volume of the ami produced by > packer. What am I doing wrong? > > Thanks again! > > Rich > > > > > > > -- > 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/4cf0a442-53fb-4432-bfe0-2e52af7f53e6%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/4cf0a442-53fb-4432-bfe0-2e52af7f53e6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt8uwxCZCo_86XePo7TGtEVpgNgEUk%2BEGGgbc84TP17X3g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
