OVHcloud Storage bootstrap
This bootstrap project allows you to copy your data to an OVH storage account as an easy and affordable backup solution from any cloud provider ☁️ like AWS, Azure, GCP, OVH or even from an on premise infrastructure 🏢. It's also a very siple way to start your Terraform project for OVHcloud.
-
Create your OVH infrastructure using Terraform including :
- A Public Cloud Project
- A user and password for your Public Cloud Project
- An object storage for your data with different options depending on your needs
- An object storage for the logs
-
Supports
- Storage location : Where your data will be located ?
- Storage class : What kind of storage is appropriate ? Fast, standard, archive
- Logging : Track every file operations
- Versioning : Keep version of each file ?
- Locks : Avoid any file modification
- Retention : How long should keep files ?
-
Copy your files to OVH using Rclone 🐏🐏
-
Docker container support 📦
-
Fully reusable ⚒️
-
Super easy to run 😎
- OVHcloud API credentials to authenticate
- Terraform
- Docker (Optional)
-
Clone the repo using
git clone https://github.com/altoviz/ovh-storage.git
-
Make script files executable
cd ovh-storage chmod -R +x \*.sh
-
The credentials
The first time you'll run any provided script, it will ensure that you have provided the OVHcloud credentials but you can start by running :
./credentials.sh
If it does not exists, a credentials-private.sh file will be created containing something like :
#!/bin/sh export OVH_APPLICATION_KEY_PRIVATE="<Your Application Private Key>" export OVH_APPLICATION_SECRET_PRIVATE="<Your Application Secret>" export OVH_CONSUMER_KEY_PRIVATE="<Your Consummer Key>" export OVH_REGION="<Your Deployment Region>" export OVH_ENDPOINT="<OVH endpoint>"
You will have to replace the placeholders with the corresponding values. You can get the values using the following tutorial Getting started with OVHcloud API. The important part is the ability to create an API key.
-
The infrastructure
To make things as simple as possible, we decide to use Terraform to setup the infrastructure. As every Terraform project, you will have to go through the init-plan-apply process. There's a script for each step so you don't even have to know Terraform.
./terraform-init.sh ./terraform-plan.sh ./terraform-apply.sh
Now, you should have a running infrastructure in OVHcloud.
-
The data synchronization process
You can use whatever AWS S3 compatible tool you want to interact with OVHcloud object storage as it supports the defacto standard.
We use Rclone to sync our data, a script file to run it and a Docker container to make it easy to run it everywhere.
These are the 3 simple steps to run it. First, we build the docker container, then we run it and finaly, we display the output logs of the running container.
./docker-build.sh ./docker-run.sh ./docker-logs.sh
Documentation about the 5 main features of the object storage
Versioning (TBD)
Rclone a CLI tool of choice for very simple but effective copy and sync of files in cloud storage.
Follow this tutorial about using Rclone with OVH
The Docker file will use those environment variables to update the Rclone configuration.
- OVH_S3_ACCESS_KEY_ID
- OVH_S3_SECRET_ACCESS_KEY
- OVH_S3_REGION
- OVH_S3_BUCKET
Check the script file for a usage example.
- Mount a Rclone config file
- Mount more than one data volume
- Add more variable to support another storage provider for a cloud to cloud approach
This project is freely provided by Altoviz as is. Use it at your own risk and benefit as long as you have fun doing it 😊.