Is there any easy way to boot a droplet from an existing volume instead of a boot image?
I’d like to be able to spin up a machine and tear it down again - and maintain all the installed packages without having to re-install from apt each time.
I don’t necessarily want a custom image for this, as I want the whole disk context to be persistent (while the actual droplet can be destroyed)
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!
Hello @kieranbingham ,
You can take a Snapshot of the Droplet. Creating a snapshot saves everything from the Droplet or volume’s disk to a disk image saved in your DigitalOcean account. Snapshots persist on your account even after the Droplet is destroyed. You will be able to create a new Droplet from the Snapshot anytime. Please refer to the following articles for more details https://www.digitalocean.com/docs/images/snapshots/ https://www.digitalocean.com/docs/images/snapshots/how-to/
Hope this helps!
Cheers, Lalitha
Hi,
@kieranbingham wroteDoesn’t using snapshots mean that I would then have to take another snapshot
after having done any ‘work’ on the image?
Yes, it does. You would have to take a snapshot each time before destroying your droplet, otherwise you loose your recent changes. You could simplify ‘taking a snapshot/destroying a droplet’ process with a script based on DO API.
But, have you considered chrooting ? You could install an OS on an attached block storage volume using a tool like debootstrap, and then, chroot to this environment from a droplet’s OS. In that case, all the changes will remain on the attached volume.
Note.
The solution mentioned by @Lalitha has got (at least) one advantage over chrooting.
You can move a snapshot to another region and spin up a new droplet there. You cannot
do that with a volume.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.