>
>  I expected to have the volume being mounted during bake time, but it
> actually being created during AMI creation.


You have ami_block_device_mappings and launch_block_device_mappings, they
take the same settings but the first one is created when an instance is
launched to bake the ami. The second one is only put into the resulting
metadata when the ami is created and will only affect the instance launched
from you ami. See the docs.

On 31 October 2016 at 14:50, Rickard von Essen <[email protected]>
wrote:

> This took me some time to spot but it's quite easy. t2.micro instances are
> EBS only, you define "virtual_name": "ephemeral0" which is a instance store
> attached device and volume_type, delete_on_termination which is EBS only
> options. It feels a bit weird that aws-sdk-go and the AWS api just ignores
> it.
>
>
> On Friday, October 28, 2016 at 10:15:07 PM UTC+2, Tom Wu wrote:
>>
>> I have the following builders
>>
>>
>>   "builders": [
>>     {
>>       "type": "amazon-ebs",
>>       "access_key": "{{user `aws_access_key`}}",
>>       "secret_key": "{{user `aws_secret_key`}}",
>>       "region": "us-east-1",
>>       "source_ami": "ami-2d39803a",
>>       "ssh_pty": true,
>>       "instance_type": "t2.micro",
>>       "ssh_username": "ubuntu",
>>       "ami_block_device_mappings": [
>>         {
>>           "device_name": "/dev/sdb",
>>           "virtual_name": "ephemeral0",
>>           "volume_size": 100,
>>           "volume_type": "gp2",
>>           "delete_on_termination": false
>>         }
>>       ],
>>       "ami_name": "Test {{timestamp}}"
>>     }
>>   ]
>>
>> I am not able to see the volume is being created during a --debug mode
>> and checking the build node
>>
>> df -h
>> Filesystem      Size  Used Avail Use% Mounted on
>> udev            492M   12K  492M   1% /dev
>> tmpfs           100M  336K   99M   1% /run
>> /dev/xvda1      7.8G  797M  6.6G  11% /
>> none            4.0K     0  4.0K   0% /sys/fs/cgroup
>> none            5.0M     0  5.0M   0% /run/lock
>> none            497M     0  497M   0% /run/shm
>> none            100M     0  100M   0% /run/user
>> root@ip-172-31-57-226:~# lsblk
>> NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
>> xvda    202:0    0   8G  0 disk
>> └─xvda1 202:1    0   8G  0 part /
>>
>> Am I using it wrong?
>>
> --
> 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/58998108-c39d-4988-978c-7b698da7ae67%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/58998108-c39d-4988-978c-7b698da7ae67%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/CALz9Rt-hC4yUi%2BOi63uRwB0B4X01N08%3DgN_6mkhQWF3G_nXAWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to