

Packer is a tool for creating identical machine images for multiple platforms - routelastresort
http://www.packer.io/

======
mitchellh
Hey everyone. Packer guy here. I've been working on Packer the past couple
months and I think its time to bring this to the public. I'm happy to answer
any questions you have.

I want to stress that this is the _first public release_. There is a lot of
work to be done and a lot of improvements to be made. It may not be
"production ready" but it is definitely "experimentation ready." Although I
know many companies already starting to use this in production.

I also want to note that although I made Vagrant as well, Packer is not tied
to Vagrant in ANY WAY. Packer stands on its own as an extremely useful tool.
However, Packer can be used to make Vagrant boxes, as well.

ENJOY!

~~~
RyanZAG
A tutorial showing every step from start to finish for creating something
simple, such as a webserver running a database with some custom html pages
would be really great.

The docs look good, but it's hard to see which steps to follow in what order
for someone who hasn't tried to automate this kind of thing before.

~~~
mitchellh
The intro actually has a decent step-by-step getting started guide:
[http://www.packer.io/intro](http://www.packer.io/intro) I welcome any
feedback!

~~~
StavrosK
Goddamn, that is one beautiful theme.

~~~
twog
Agreed. If you dont mind me asking mitchellh, who did the design?

------
StavrosK
Okay, can someone please explain Packer/Vagrant/etc to me? The way I currently
provision is using ansible, I have a script that goes from bare machine to
serving the site in one command ([http://www.stavros.io/posts/example-
provisioning-and-deploym...](http://www.stavros.io/posts/example-provisioning-
and-deployment-ansible/)).

How does something like Packer/Vagrant help me? From what I understand, all
they do is create a VM, which just takes two seconds in VirtualBox anyway.
There must be a benefit, since everyone is using them, but I'm missing it. Can
anyone please explain?

~~~
njharman
> How does something like Packer/Vagrant help me?

Totally depends on what you need doing. Might want to check out use cases in
the packer documentation.

There is some overlap in all these tools. ThAnsible/Salt/Chef/Puppet tend to
used to manage "live" OS's/systems, keeping them updated, deploying new builds
to them. Although some like Ansible are more generic.

Vagrant and Packer(I know little) manage images. Starting, stoping,
provisioning (and often running one of the above Configuration Managments to
finish customizing. Although some believe in running from pure AMI, updating
them instead of the live systems).

They get more power when there are many devs, lots of images. I.E. when you
have enough complexity you need help managing it.

If your small or simple (no negative connotation implied) they probably aren't
worth it. I'm one man shop and use Ansible cause it's the right fit for that
(although it's expanding fast).

~~~
StavrosK
Hmm, so what they do is generate an image, "freeze" and deploy it? I'm not
very big on that philosophy, I prefer having a script to take the system from
a clean state to the current state at all times, but I guess that's just
preference.

Maybe it's just that I don't have a big enough need for it, but I did see
people using it for single VMs/servers, so I was wondering.

Thanks for the explanation! Also, have you seen ansible's pull mode? I just
saw it the other day and I am itching to try it, it looks phenomenal.

~~~
dekz
Well Vagrant existed as a way to take some known state and run it headless. It
was good to say, "Here is the image we run on, now develop on it", where that
image may not be your actual desktop machine. It helps avoid the "issue" of
the problem being yours (desktop, rbenv, wrong openssl etc) and not mine (or
code). This worked by running Virtual box in a headless mode and doing some
nifty things to the VM (through SSH) for you.

Then it took on the optional use case of also running some Provisioning ontop
of the VM. We could start from a base ubuntu, get to a point where our app
could run and then deploy the app ontop. It was a little cumbersome but it
worked.

Then Mitchel started adding other platforms for it to run under (VMWare
Workstation) instead of just VirtualBox. I believe he is still working on
these and is adding more like VMWare VSphere.

So Vagrant was always more to do with running of the VMS or taking the VMs and
putting them somewhere and turning them on. Packer is more of the former tool
of creating the VM in the first place I guess.

I feel from the little I do know that Packer and Vagrant seem to be sharing
some of the same goals and solutions. I guess mitchel and comment further on
where he plans to draw the line between the two.

~~~
StavrosK
I see, thanks. I guess creating VMs has never been a big problem for me, but,
then again, it sounds like Vagrant isn't targeted towards me.

------
geetarista
For anyone coming from veewee, there is a tool for converting templates to
packer: [https://github.com/mitchellh/veewee-to-
packer](https://github.com/mitchellh/veewee-to-packer)

~~~
mitchellh
And more user-friendly docs for that:
[http://www.packer.io/docs/templates/veewee-to-
packer.html](http://www.packer.io/docs/templates/veewee-to-packer.html)

------
jimmcslim
Can Packer meaningfully work with Docker.io? I gather there is some overlap,
but is there a way they can work together? It seems to me:

* Packer abstracts creation of images.

* Vagrant abstracts running images, via a VM, and applying changes to images (via chef/puppet, although that seems to overlap with Packer as well).

* Docker seems to abstract both creation of images (via docker build) and running of images (albeit only on top of LXC).

To complicate things further, it seems like Vagrant has some initial support
for running (Linux) images on top of LXC (via Fabio Rehm's plugin) and
possibly on top of Docker (although the state of the plugin for this is
vague).

All this stuff seems very powerful, but the overlap is confusing. My head
hurts...

------
lojack
I'm curious where this fits in with my Vagrant/chef workflow where I load a
virtual environment with vagrant and provision both development environments
and production environments with chef.

Seems as though there's some overlap between how I provision environments and
where this tool fits in. What would be the advantages moving this away from my
provisioning tool and towards Packer?

------
druiid
Sounds interesting for sure. I don't see any built-in ability to generate
qcow2 style images though. Are you going to add that? There are ways to
convert (like from a virtualbox image), but having the built-in ability to
create qcow2 would be great. Even better would be having a keystone/glance
connector to upload generated images to Openstack!

~~~
mitchellh
Yep, definitely.

------
csears
Can Packer build Windows images?

~~~
mitchellh
It is missing a single crucial feature, but yes it will be ABLE to. The next
release. It can currently build OS X machines fine though.

------
zimbatm
Packer mentions continuous delivery in the intro documentation[1]. Is there a
scenario where you install the result on existing systems or do you rolling
deploys with new VMs all the time ? I'm specifically thinking of services that
need to maintain state like databases where the second scenario is not very
handy.

[1]: [http://www.packer.io/intro/use-
cases.html](http://www.packer.io/intro/use-cases.html)

------
Nux
Surprised not to see support for KVM.

------
bpatrianakos
I could totally use this! The only question I have is can you exclude certain
things. I'd want to clone 95% of a production server but then would need to
exclude SSL settings and such.

~~~
mitchellh
You choose what you want in the final images, so you can exclude whatever
you'd like. You basically have complete control over what gets installed, it
doesn't hold your hand in any way, really.

------
joemaller1
This is seriously ambitious! Glad to see it, a tool for cloning existing boxes
was the first thing I went looking for when I started using Vagrant.

------
zeckalpha
Not to be confused with
[https://github.com/keenerd/packer](https://github.com/keenerd/packer)

------
julnepht
Is there any PXE boot support with Packer ? How does Packer compare to Cobbler
+ Koan ?

------
tmzt
Is it possible to build AMIs offline? Why is it starting an instance for the
source AMI?

~~~
mitchellh
It is explained in the opening paragraphs here[1] but I'll explain.

There are two ways to make AMIs: EBS-backed or instance-store. For instance-
store, you basically need to debootstrap a chroot or something like that. You
can do this offline, technically. EBS-backed you just launch a source AMI,
build on that, then re-snapshot it.

For the purposes of a 0.1, Packer currently only supports the EBS-backed
approach. This is not a technical limitation, however, and in a future version
I do want to add the ability to make instance store.

[1]: [http://www.packer.io/docs/builders/amazon-
ebs.html](http://www.packer.io/docs/builders/amazon-ebs.html)

~~~
tmzt
Okay, I guess the question was is it possible to pull down a source AMI
without starting an instance, then build the new AMI based on that.

~~~
mitchellh
No, that's not planned. I've actually not seen/read anything that does this.
If it is possible, it is certainly interesting, but I have a feeling that this
would be very tricky.

------
nusbit
May I als you why you choose golang, I am just interested im your opinion.

------
ksec
Written in Ruby as well?

Edit: Just Checked GitHub, it is Written in Go, Interesting..... Another sign
of Ruby being painfully slow.

~~~
nwjsmith
I doubt this is why Go was chosen over Ruby, it would be fast enough for this
problem. It probably has more to do with distributing the software.

Distributing programs in written in Go is _much_ easier that distributing them
in Ruby, i.e. cross compile and ship the binary, but distribution of Ruby
programs is hard.

Too much time is wasted on 'omnibus' projects to distribute Ruby programs,
just look at Chef or Sensu or Mitchell's own Vagrant installers project:

[https://github.com/mitchellh/vagrant-
installers](https://github.com/mitchellh/vagrant-installers)

(I don't mean to say those projects were a waste of time, but that it seems
like this should be a 'solved' problem).

~~~
timmow
This seems to me to be an issue that there is some disagreement on between
devs and ops people - most devs are happy to distribute software with a
Gemfile and see it as a solved problem. Ops packages tend to go the omnibus
route like Chef has, or use Jruby and package as a Jar file like
[http://logstash.net/](http://logstash.net/)

I wonder if there is anything developers can do as a community to help solve
the problems these distributors feel they have?

------
wnevets
would I use this instead of vagrant or with vagrant?

~~~
mitchellh
On its own or with Vagrant. Packer is useful on its own but also integrates
well with Vagrant if you use it.

------
NHQ
neat!

