When creating a Digitalocean Volume, it is required to specify a droplet to attache the volume to. Is it possible to instead create a standalone Volume, and attach it to a droplet at a later stage?
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.
Hi,
You can create detached volume with DO API. I tested it using both
curl
andRuby
. Let’s focus oncurl
because it is usually installed by default on most of Linux distros. ####Prerequisites####1. You must have
curl
installed. To check if you havecurl
installed run following commandIf you have it installed, you will get the response like that:
If you do not have it installed, you can install it with your distro’s standard package manager. Two examples below:
2. You must have DO Personal Access Token set up. If you do not have it, go to API section in DO control panel and generate new token accordingly to the DO tutorial.
####Creating a detached volume####
I am using an example from DO’s API documentation. To create a detached volume, run the command below. But before you will do it, customize its parameters. The parameters are well described in previously mentioned DO’s API documentation, however, I am highlighting some of them:
ext4
andxfs