Question

Volume snapshot creation with "doctl" ?

Hi,

Is it possible to generate volume snapshot using the “doctl” command line utility ?

Thanks in advance !

/Xavier

Subscribe
Share

Submit an 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.

how can restore a volume snapshot?

@xMudrii @jtittle

A big thanks for these informations ! I’ll try.

/Xavier

@XavierResoLv @jtittle

doctl supports volume snapshot creation, but it’s not documented in the tutorial. Updated tutorial is work in progress and I guess it should be published in the near future.

First, make sure you have doctl version 1.6.0 or newer. Check your doctl version by running doctl version. If you need to update, you can take a look at Installation part of tutorial.

To initiate volume snapshot, you need to use snapshot command which requires volume-id as an argument and --snapshot-name flag:

  1. label Example command
  2. doctl compute volume snapshot volume-id --snapshot-name "Volume-1 Backup 20170620"

If you need to obtain volume-id, you can use doctl compute volume list command.

@XavierResoLv

Right now, doctl only supports attach and detach actions against the volume API. That’s not to say that it won’t be supported in the future, though it’s not supported as of this response.

https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client

https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client#initiating-volume-actions