For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pt/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pt/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/pt/guides/hosted-private-cloud/cloud-platform/snc-cloud-platform-save-instance.md.

Backing up and cloning an instance

Ver como Markdown

Find out how to back up an SNC Cloud Platform instance (system volume snapshot, Restic) and create a new instance from the backup (clone)

Objective

This guide presents two complementary methods for backing up an SNC Cloud Platform instance:

  • Full system backup: a snapshot of the system volume is turned into an image, which can be kept, downloaded off-platform for external backup, or used to recreate an identical instance (clone).
  • Application data backup: a tool such as Restic automates backups of your instance data to Object Storage. The backups can be used to restore your data in the event of a problem.

Requirements

  • An instance
  • For the snapshot/clone method: access to the OpenStack console (Horizon) or a configured OpenStack CLI (see the Creating an instance and connecting to it guide for CLI installation and configuration)
  • For the Restic method:
    • An Access Key generated for Object Storage
    • Restic installed
    • S3cmd installed and configured with the Access Key

Instructions

Backing up and cloning via a volume snapshot

For reference, a volume is attached to every instance as the system disk. Overall, the operation therefore consists of backing up this volume, then creating a new instance from that backup. In detail, this involves:

  • creating a snapshot of the volume
  • creating a volume from that snapshot
  • uploading this volume as an image
  • cleaning up the previously created volume and snapshot (if they are no longer needed)

An instance can then be created from that image.

These operations cannot be performed from the Regional Panel for now. You must use the OpenStack console (Horizon) or the OpenStack CLI.

Horizon
OpenStack CLI

Log in to the OpenStack console by clicking the Open horizon button from the Regional Panel.

Open horizon button in the Regional Panel

Go to the Instances menu and click on the instance to back up (the test instance in this example).

Instances list with the test instance

In the Volumes Attached section at the bottom of the instance details page, click the attached volume.

Volumes Attached section showing the volume attached to the instance

You can also find the volume in the Volumes menu by searching for the one attached to the instance.

Volumes menu with the volume attached to the instance

Then create a snapshot of the volume:

Create Snapshot action on the volume

Name it and click Create Volume Snapshot (Force). The operation is almost immediate.

Warning

Creating a snapshot of a mounted, in-use volume is crash-consistent but not application-consistent. To guarantee 100% consistency of the backed-up data, it is recommended to stop the instance beforehand.

Snapshot creation form for the selected volume

Go to the Snapshots menu and create a volume from the snapshot.

Snapshots menu with the create volume action

Name it and leave the other values unchanged. Start the volume creation. The operation is almost immediate.

Volume creation from snapshot form

In this example, the volume is saved as an image, which you can then download locally for external backup, for example.

Choose the Upload to Image action in the volume's list of actions.

Upload to Image action in the volume actions list

Name the image, and keep Raw as the disk format. Start the upload.

Upload to image form with Raw disk format

The volume switches to the Uploading status. Image creation time depends on the volume size. Wait until the image is fully created.

If you no longer need them, delete the previously created volume first, then the snapshot.

To create a new instance from the image, go to the Images menu and click the Launch action for the image.

Launch action on the image in the Images menu

The instance creation wizard then opens, as described in the Creating an instance and connecting to it guide.

In summary:

  • in the Details menu, name the instance and choose nova-vm as the Availability Zone
  • in the Source menu, click Yes for Create New Volume and set the appropriate size
  • choose the flavor in the Flavor menu
  • choose Ext-Net as the network
  • do not choose a key pair: the configuration will not be applied. The instance's authorized_keys file will not be modified.

Then launch the instance creation by clicking Launch Instance and wait for the instance to reach the Running state.

At instance startup, cloud-init will detect that the instance has changed and will reinstall the proper network configuration. Then connect to the instance with its public IP address.

Backing up data with Restic (Object Storage)

Info

The Restic backup tool is used to describe one possible method for performing backups. You are free to choose the solution that suits you best.

Creating a bucket to store the backups

Enter the following command:

$ s3cmd mb s3://backup

Initialising the backup repository

Start by choosing a password to encrypt your backups. In this guide, GPG is used for this purpose:

$ gpg --gen-random --armor 1 20

Make a note of this password in a safe place, along with your S31 credentials. Next, the Restic configuration will be placed in environment variables. This includes sensitive information, such as your S3 secret and the repository password. As a result, make sure that the following commands do not appear in your shell history file. Adjust the contents of the environment variables according to your bucket name, the region, and your user's API credentials.

unset HISTFILE
export AWS_DEFAULT_REGION="eu-west-rbx-snc"
export AWS_ACCESS_KEY_ID="06bd244758d047eea26eb9cc1e572be7"
export AWS_SECRET_ACCESS_KEY="55db67712e594cd8a557abfd7a33a743"
export RESTIC_REPOSITORY="s3:https://s3-beta.eu-west-rbx-snc.cloud.snc.ovh.net/backup"
export RESTIC_PASSWORD="BYhISmzRvIPMwvbzgl8ROQ=="

Once the environment is configured, the Restic command can be called to initialise the repository:

$ restic init
created restic repository 821bcf92bf at s3:https://s3-beta.eu-west-rbx-snc.cloud.snc.ovh.net/backup

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.

Restic is now ready to be used with S3. Try creating a backup:

$ restic backup /var/log/
repository 821bcf92 opened (repository version 2) successfully, password is correct
no parent snapshot found, will read all files
error: open /var/log/btmp: permission denied
error: Open: open /var/log/private: permission denied

Files:          30 new,     0 changed,     0 unmodified
Dirs:            7 new,     0 changed,     0 unmodified
Added to the repository: 745.784 MiB (173.112 MiB stored)

processed 30 files, 750.189 MiB in 0:04
snapshot 38e47b16 saved
$ restic snapshots
repository 821bcf92 opened (repository version 2) successfully, password is correct
ID        Time                 Host        Tags        Paths
---------------------------------------------------------------
38e47b16  2025-12-22 00:24:23  demo                  /var/log
---------------------------------------------------------------
1 snapshots
Info

A snapshot has been created.

Check the contents of the bucket:

$ s3cmd la
                          DIR  s3://backup/data/
                          DIR  s3://backup/index/
                          DIR  s3://backup/keys/
                          DIR  s3://backup/snapshots/
2025-12-22 00:22          155  s3://backup/config
Info

A backup has been created and stored in the S3 bucket.

Go further

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Join our community of users.

1: S3 is a trademark of Amazon Technologies, Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies, Inc.

Esta página foi útil?