How to tell packer not to delete the instance used to build the AMI

44 views
Skip to first unread message

Subhashini Radhakrishnan

unread,
Nov 15, 2018, 7:50:10 PM11/15/18
to Packer
Once the packer is finished building an AMI, it terminates the instances used to build the AMI from.

Is there an option to specify not to terminate the instance once AMI is generated successfull?

Muthu R D

unread,
Nov 16, 2018, 12:19:48 AM11/16/18
to Packer



On your "builders" portion in your JSON, add the below item to keep them registered in there.

"keep_registered": true



Thanks!
Muthu

Rickard von Essen

unread,
Nov 16, 2018, 12:41:49 AM11/16/18
to packe...@googlegroups.com
That option doesn't exist for any Amazon builder. And there is no similar option. Why do you want to keep it running? 

--
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/7d0895a6-cf3c-4dde-93b2-e447128a20bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Subhashini Radhakrishnan

unread,
Nov 16, 2018, 1:27:11 PM11/16/18
to Packer
Thank you for the reply... 
we first build a BASE AMI... and then our scripts use the IP Address of the base AMI to build other dependent AMIs to download the package via network share... 
our scripts are built that way to use the IP address of the BASE AMI's instance...

I guess I will have to launch an instance from the BASE AMI and then use it ..

Subha

unread,
Nov 16, 2018, 6:00:15 PM11/16/18
to packe...@googlegroups.com
Hi Muthu,

Thanks for your reply. i added keep_registered in the builder section but it failed.. :( 

amazon-ebs output will be in this color.

1 error(s) occurred:

* unknown configuration key: "keep_registered"




--

lucas.adam.jackson

unread,
Nov 16, 2018, 6:18:14 PM11/16/18
to packe...@googlegroups.com
Some builders dont have a keep_registered option ... I haven't used this builder but assume that is the case here



Sent from my Samsung Galaxy smartphone.

Alvaro Miranda Aguilera

unread,
Nov 17, 2018, 10:48:07 AM11/17/18
to packe...@googlegroups.com
Hello

Depending on what you wan, you will think to build a pipeline.

If you want to package ami, then on packer you can do

Packer:
Base AMI -> Intermediate AMI -> Install product A / run scripts -> AMI for product A
Base AMI -> Intermediate AMI -> Install product B / run scripts -> AMI for product B
Base AMI -> Intermediate AMI -> Install product C / run scripts -> AMI for product C


And you will end with r 4 AMI, base + 4 product.

If what you want is take a base AMI and start a box that will be a server.

Then packer may not bet the tool you are after.

Have a look at terraform to create a EC2 server and you could use a provision script to configure the server.


Alvaro


For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages