Report this

What is the reason for this report?

Packer Image create a snapshot instead of an image

Posted on November 22, 2023

I had created a packer image that runs a shell script after booting a droplet using ubuntu.

The problem is that if I use that snapshot it will create droplets with the same data from the snapshot (obviously because is a “copy of another droplet”)

what I want to achieve is to run the script each time a droplet is created from that “snapshot” not to have the same data propagated over every droplet.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya @andresogando,

I’m not sure I understand you entirely so let me try to reiterate and you can confirm or deny if It’s correct:

You’re looking/trying to create a process where a script runs each time a new droplet is created from a snapshot in Packer with Ubuntu, is that correct?

You’ll need to set up your script to execute as part of the droplet’s startup process. This way, every time a new droplet is created from the snapshot, the script will run afresh, allowing for dynamic data handling or configuration rather than just replicating the snapshot’s state.

Let me know if that is what you need to achieve or if I’m mistaken please provide a more detailed explanation and we can take it from there.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.