Git Product home page Git Product logo

ovh-snapshot's Introduction

Easily snapshot OVH instances using Docker

Configuration

Create an API application on https://eu.api.ovh.com/createApp/ and write down the provided APPLICATION_KEY and APPLICATION_SECRET. You'll also need your PROJECT_ID.

Then, run the image in interactive mode to request your consumer key:

docker run -it \
  -e ENDPOINT="YOUR_PUBLIC_CLOUD_ENDPOINT" \
  -e APPLICATION_KEY="THE_APPLICATION_KEY" \
  -e APPLICATION_SECRET="THE_APPLICATION_SECRET" \
  quay.io/hunter-io/ovh-snapshot python credentials.py

Follow the instructions, and write down the gotten CONSUMER_KEY.

You can now run the image again to list all the instances of your project:

docker run \
  -e ENDPOINT="YOUR_PUBLIC_CLOUD_ENDPOINT" \
  -e APPLICATION_KEY="THE_APPLICATION_KEY" \
  -e APPLICATION_SECRET="THE_APPLICATION_SECRET" \
  -e CONSUMER_KEY="THE_CONSUMER_KEY_FROM_PREVIOUS_STEP" \
  -e PROJECT_ID="YOUR_PROJECT_ID" \
  quay.io/hunter-io/ovh-snapshot python instances.py

This command is useful to retrieve the identifiers of the instances you want to snapshot.

Usage

Once you got the APPLICATION_KEY, APPLICATION_SECRET, CONSUMER_KEY and INSTANCES, you can run the image without command to launch a snapshot of all the provided instances:

docker run \
  -e ENDPOINT="YOUR_PUBLIC_CLOUD_ENDPOINT" \
  -e APPLICATION_KEY="THE_APPLICATION_KEY" \
  -e APPLICATION_SECRET="THE_APPLICATION_SECRET" \
  -e CONSUMER_KEY="THE_CONSUMER_KEY_FROM_PREVIOUS_STEP" \
  -e PROJECT_ID="YOUR_PROJECT_ID" \
  -e INSTANCES="COMMA_SEPARATED_LIST_OF_INSTANCE_TO_SNAPSHOT" \
  -e CRONITOR_URL="Cronitor URL to ping (optional)" \
  quay.io/hunter-io/ovh-snapshot

You can also run the same image with the python cleanup.py command to keep only NUMBER_SNAPSHOTS_TO_KEEP per instance:

docker run \
  -e ENDPOINT="YOUR_PUBLIC_CLOUD_ENDPOINT" \
  -e APPLICATION_KEY="THE_APPLICATION_KEY" \
  -e APPLICATION_SECRET="THE_APPLICATION_SECRET" \
  -e CONSUMER_KEY="THE_CONSUMER_KEY_FROM_PREVIOUS_STEP" \
  -e PROJECT_ID="YOUR_PROJECT_ID" \
  -e INSTANCES="COMMA_SEPARATED_LIST_OF_INSTANCE_TO_SNAPSHOT" \
  -e NUMBER_SNAPSHOTS_TO_KEEP=4 (default: 3) \
  -e CRONITOR_URL="Cronitor URL to ping (optional)" \
  quay.io/hunter-io/ovh-snapshot python cleanup.py

TODO

  • Improve the error handling

ovh-snapshot's People

Contributors

bastienl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ovh-snapshot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.