Doctl Spinup droplet from previous snapshot

January 10, 2017 439 views
DigitalOcean Linux Commands API Ubuntu

I've been trying to spinup droplets from previous snapshots, but the cli command requires the image Slug. is there a way to add a slug to a snapshot ?

1 Answer
jtittle1 January 10, 2017
Accepted Answer

@Skyscrapers

As far as I can see, you can't add a slug, though you don't need to provide doctl with a slug to create a new Droplet using a previously generated snapshot, you just need to pass the ID of the snapshot in place of the slug.

So, for example, I pulled a list of images using:

doctl compute image list

The last image in the list was a snapshot I created before running that command. I then took the ID of that image and passed it to the create command and it created a new droplet using the snapshot.

doctl compute droplet create name --size 8gb --image ID_OF_IMAGE --region nyc1 --ssh-keys FP_SSHKEY

Just sub out ID_OF_IMAGE with the image ID of your snapshot and FP_SSHKEY with the fingerprint for your SSH Key.

Have another answer? Share your knowledge.