Creating temporary drives only during image build

13 views
Skip to first unread message

John Jones

unread,
Dec 26, 2019, 7:15:00 PM12/26/19
to Packer
I'm trying to create a temporary drive during the packer build so i can make references to that additional drive in IIS virtual directories.  But i don't want this drive to be included in the AMI created, because a network drive will be used instead.
It appears that both the ami and launch_block_device_mappings result in an AMI created with those drives included.  How do add a drive during the build so that I can configure IIS, but not have the drive included in the AMI?

Here is what i am using so far, but results in /dev/sdf included in the AMI.

"launch_block_device_mappings": [
        {
          "device_name""/dev/sda1",
          "volume_size"50,
          "volume_type""gp2",
          "delete_on_termination"true
        },
        {
          "device_name""/dev/sdf",
          "volume_size"50,
          "volume_type""gp2",
          "delete_on_termination"true
        }
       ],

Rickard von Essen

unread,
Dec 27, 2019, 4:28:34 AM12/27/19
to packe...@googlegroups.com
If I remember correctly you first add the device in launch_block_device_mappings and then in ami_block_device_mappings you add the same device again, but this time with the no_device set to true. 


--
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/cd006c7a-8005-4ef9-bac1-4f8f582da636%40googlegroups.com.

John Jones

unread,
Dec 27, 2019, 3:04:53 PM12/27/19
to Packer
That was it!  Thank you Sir!
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages