Snapshots are reliable fail-back points for DigitalOcean Droplet owners.
Server owners create DigitalOcean Droplets from snapshots when there is an unexpected server crash, to create a Droplet in another location, etc.
But, how to make sure that this process goes off without a hitch?
At Bobcares, we often receive requests from DigitalOcean customers to create Droplets from snapshot as part of our DigitalOcean Managed Services.
Today, let’s see the steps followed our Support Engineers to create a Droplet from snapshot.
DigitalOcean : Create Droplet from Snapshot – 2 important steps
Here are 2 important steps to create a DigitalOcean Droplet from a snapshot.
1) Take a Droplet snapshot
Firstly, our Support Engineers create a snapshot of the existing Droplet to save all the current contents of the Droplet.
If you already have a working snapshot, skip this step.
This involves 2 steps.
a) Power off the Droplet
We always power off the Droplet before taking the snapshot to avoid data inconsistency.
For instance, when taking a snapshot on a running Droplet, databases don’t guarantee consistent data.
That is, it takes a while to copy a file and the files may change as you copy them, so your backup file become an inconsistent snapshot.
So, as a precaution, we always poweroff the Droplet before taking the snapshot.
Users can poweroff the Droplet from Power >> Poweroff option in the DigitalOcean control panel.
However, we always poweroff the server via SSH, because this ensures that all the services are stopped before the server is shutdown.
For instance, we use the below command to shutdown the server from command line.
shutdown -h now
b) Take a snapshot of the Droplet
The next step is to take the Droplet snapshot.
Our Support Engineers usually take the snapshot from Snapshots > Take Snapshot option in DigitalOcean control panel.
Alternatively, in some cases, we have to take the snapshot of a running Droplet.
In such cases, we take the snapshot from Snapshots > Take Snapshot > Take live Snapshot in DigitalOcean control panel.
2) Create a new Droplet from snapshot
The second step is to create a new Droplet from the snapshot.
Our Support Engineers follow the below steps to create a new droplet from the snapshot.
- Click Create > Droplets.
- Click on Snapshots.
- Select the snapshot.
- Select the size, Droplet region and additional parameters.
- Click on Create.
Alternatively, when we need to create multiple Droplets from the snapshot, we use the command line utility to speed up the process.
For that, we use the DigitalOcean doctl command line client. It uses the DigitaOcean API to access Droplet features.
For instance, we use the below command to create a Droplet from snapshot.
doctl compute droplet create testserver --size 1gb --image debian-8-x64 --region nyc1
Here testserver is the Droplet name, Droplet size is 1GB, snapshot name is debian-8-x64 and Droplet region is nyc1.
Most importantly, when creating a new Droplet from snapshot, we ensure that the disk space of the new Droplet is equal to or larger than the Droplet used in snapshot.
This ensures that there is no loss of data during this process.
Also, when a new Droplet is created, it transfers all SSH keys and user accounts from the time the snapshot was created.
Once we create the new Droplet from the snapshot, we always test the services on the new instance as there may be chances that some services will not set to start at boot.
[Need assistance in creating a new Droplet from a snapshot? Our DigitalOcean Experts will get it for you.]
DigitalOcean : Create Droplet from Snapshot – Common failure points
Although creating Droplet from snapshot is a pretty straight forward process, we’ve seen that this can sometimes fail.
Let’s discuss some common scenarios here.
1) Create Droplet from snapshot in different region
We’ve seen customers complain that they get the below error when creating a Droplet from a snapshot in a different region.
The image you specified is not available in the selected region, you can make it globally available by initiating an image region transfer from the images tab.
In order to create a Droplet from a snapshot taken in another datacenter, this snapshot should be transferred to the region where the new Droplet should be created.
Our Support Engineers transfer the snapshot to other regions from Snapshots > Droplet snapshots > More > Add to region > Click on region name. to fix this issue.
[Need assistance in fixing this error? Our DigitalOcean Experts will help you fix this problem.]
2) Create Droplet from command line
Droplet owners usually create Droplets from command line using the snapshots with image slug (for example, centos-6-5-x32, centos-6-5-x64, etc).
However, in some cases, the snapshots don’t come up with a slug to uniquely identify it.
So, in such cases, our Support Engineers get the unique image ID and use it for Droplet creation.
For instance, to create a new Droplet from an image, we first get the unique image ID using the below command.
doctl compute image list-user
After that, we create a new Droplet from the image with this image ID.
doctl compute droplet create testserver --size 1gb --image imageID --region nyc1
Replace imageID with the unique image ID.
Conclusion
In short, create DigitalOcean Droplet from snapshot is useful when there is unexpected server crashes, migration to a new location, and more. Today, we’ve discussed the steps to create a DigitaOcean Droplet from snapshot and the common failure points and how our Cloud Experts fix them.
Hi,
After creating droplet from snapshot when I open ipv4 address from browser it’s not working.
Do you have any idea regarding the same?
Hi Umang,
Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).