How NOT to terminate/destroy VMs/Droplets on EC2/DO?

1,264 views
Skip to first unread message

M_H

unread,
Jan 31, 2014, 8:55:45 PM1/31/14
to packe...@googlegroups.com
Hi,

What I understood from my experience with packer for the last few days (please correct me if I'm wrong), the end result packer builds is always an image. It creates VMs on EC2 or Digitalocean, runs provisions on them and finally saves the image and terminate/destroy that machine.

Is it possible to configure packer so that it stops right after preparing the VM, and doesn't go into creating AMI/Snapshot and destroy the VM? Sometimes, when I just want a running VM, creating the VM again from the saved images becomes an unnecessary extra step.

Is that possible somehow?


Viktor Vad

unread,
Feb 1, 2014, 8:42:33 AM2/1/14
to packe...@googlegroups.com
I have not yet done this feature but I suggest reading/trying out the one written under "Input artifacts" section on http://www.packer.io/docs/templates/post-processors.html . I assume here that after being built the DO Droplet would be intact and still running. I wish to hear what'll be your experience with that.

Jack Pearkes

unread,
Feb 1, 2014, 9:47:11 AM2/1/14
to packe...@googlegroups.com
If you're actively debugging an image build, it's likely that this can be dealt with via the `-debug`[1] flag.

Otherwise, if you intend to use Packer to purely spin up a machine to do something, you're likely better off using Vagrant, vagrant-digitaloean[2] and vagrant-aws[3] respectively.

Packer is designed to create images for use later – whereas Vagrant is more designed to boot and manage communication with a "running" machine, for use immediately (typically for development).

I wrote about the differences between the two tools here, which may be of use: http://pretengineer.com/post/packer-vagrant-infra/

Finally, you're not "wrong" for wanting to do this! It makes sense if you have all of that configuration to use it for another reason – just thinking it may be easier to use Vagrant, and you may be able to find tools better suited for "immediate" machine use in that ecosystem. 

Viktor – keep_input_artifact is more for post_processors, which I don't think applies here. The artifact in this case would be a DigitalOcean image or AMI, not the running machine.

 

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Viktor Vad

unread,
Feb 1, 2014, 9:53:35 AM2/1/14
to packe...@googlegroups.com
Jack,

thank you for enlightening us on this matter!

I myself will look more into Vargarnt's DO capabilities as it might be the right tool over Packer in my case as well.
Reply all
Reply to author
Forward
0 new messages