Volume snapshot creation with "doctl" ?

June 20, 2017 508 views
Block Storage Storage Ubuntu 16.04

Hi,

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

Thanks in advance !

/Xavier

3 Answers

@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

DigitalOcean's web based control panel provides a convenient, point-and-click interface for managing Droplets. There are many times, however, when a command-line tool may be a preferable alternative. doctl, the official DigitalOcean command-line client, leverages the DigitalOcean API to provide access to most account and Droplet features.

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

  • label Example command
  • 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.

DigitalOcean's web based control panel provides a convenient, point-and-click interface for managing Droplets. There are many times, however, when a command-line tool may be a preferable alternative. doctl, the official DigitalOcean command-line client, leverages the DigitalOcean API to provide access to most account and Droplet features.

@xMudrii @jtittle

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

/Xavier

Have another answer? Share your knowledge.