Report this

What is the reason for this report?

Volume snapshot creation with "doctl" ?

Posted on June 20, 2017

Hi,

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

Thanks in advance !

/Xavier



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.

@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

@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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.