# Snapshots

Snapshots, often employed as a short-term solution in testing and development environments, are commonly used for patching, updates, or for quick tests with an option to rollback in case of a failure. Their utility extends to certain scenarios in production environments too, especially when undertaking high-risk operations like OS updates or potential system-altering configuration changes.

**Our snapshot implementation serves to provide rollback milestones.** When an instance is booted to a specific snapshot, it permanently destroys all data written after the snapshot was taken. In a typical scenario, accessing snapshot data requires rebooting to that snapshot, effectively discarding any data accumulated post the snapshot's creation.

It is also paramount to understand that **snapshots are not a replacement for a comprehensive backup strategy**. Snapshots reside alongside your live data on the same system and unlike a full backup strategy, they do not generally provide a separate, recoverable data copy.

## Creating a Snapshot

### Create a snapshot using the portal

This guide outlines the steps to create a snapshot in the MNX.io portal. Please note that we recommend testing the rollback functionality on your system to ensure your application recovers properly before the need arises to use it.

* **Access Instance Management** Once logged in, find and click on the "Compute" or "Instances" section in the left-hand navigation menu to access your instances.
* **Select the Instance** From the list of instances, select the instance for which you want to create a snapshot.

<figure><img src="https://1326628655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuICkx1lw9tCpXbJzFJ%2Fuploads%2FRFrIMShbxtMc9HDYDdjB%2FScreen%20Shot%202023-06-05%20at%2011.26.23%20PM.png?alt=media&#x26;token=6f9cee4c-1c07-4236-8f4c-bee383f02763" alt="" width="375"><figcaption><p>Compute > Instances > Instance Details</p></figcaption></figure>

* **Create a Snapshot** After selecting the instance, look for the "Snapshots" tab and click on it. Within this tab, find and click on the "Create Snapshot" button.

<figure><img src="https://1326628655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuICkx1lw9tCpXbJzFJ%2Fuploads%2FnueqlYcslVBtWPyGaZAS%2FScreen%20Shot%202023-06-05%20at%2011.29.05%20PM.png?alt=media&#x26;token=ed009aa4-2fe4-4d7c-a64c-da3dd2611080" alt="" width="375"><figcaption><p>Create Snapshot</p></figcaption></figure>

* **Name Your Snapshot** A dialog box will appear asking you to name your snapshot. Choose a meaningful name that will help you identify the snapshot later. It's a good practice to include the date and the state of the instance in the snapshot name. By default the name will be a datetime stamp.&#x20;

<figure><img src="https://1326628655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuICkx1lw9tCpXbJzFJ%2Fuploads%2FBjdybyfU7p1aBZEHmlLT%2FScreen%20Shot%202023-06-05%20at%2011.30.25%20PM.png?alt=media&#x26;token=a639671a-2636-47a6-b517-83fec9414e5c" alt="" width="375"><figcaption><p>Name your snapshot</p></figcaption></figure>

* **Initiate Snapshot Creation** After naming your snapshot, click on the "Create" button. The snapshot creation process will start and it may take some time depending on the size of your instance.

<figure><img src="https://1326628655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LuICkx1lw9tCpXbJzFJ%2Fuploads%2FioCVJ1eXmdhhHN7CmWHt%2FScreen%20Shot%202023-06-05%20at%2011.32.34%20PM.png?alt=media&#x26;token=cbbccb50-6cc4-4f02-bca7-c79419535ee4" alt="" width="375"><figcaption><p>Snapshot default name </p></figcaption></figure>

* **Monitor Snapshot Creation** You can monitor the progress of the snapshot creation from the "Snapshots" tab. Once the snapshot has been created, it will appear in the list of available snapshots.

### **Creating a Snapshot using the Triton-CLI Command Line Utility**

This guide will take you through the steps of creating a snapshot in the portal using the Triton-CLI command line utility. This process is a handy alternative if you prefer using the command line over the graphical user interface.

To get started, please refer to the [Triton CLI tools installation documentation](https://docs.mnx.io/api/triton-cli-tool#installation).

1. **List Your Instances** To list all of your instances, you can use the following command:

   ```
   triton instance list
   ```
2. **Create a Snapshot** To create a snapshot of a specific instance, you'll need to use the 'instance snapshot create' command followed by the instance ID. Like so:

   ```
   triton instance snapshot create <instance_id>
   ```

   Replace `<instance_id>` with the ID of the instance you want to create a snapshot for.
3. **Name Your Snapshot** To name your snapshot, append the command above with the desired name:

   ```
   triton instance snapshot create -n <snapshot_name> <instance_id>
   ```

   Replace `<snapshot_name>` with your desired snapshot name. Remember, it's a good practice to include the date and state of the instance in the snapshot name.
4. **Monitor Snapshot Creation** To check the status of your snapshot creation, use the 'instance snapshot get' command:

   ```
   triton instance snapshot get <instance_id> <snapshot_name>
   ```

   This will display the status of the specified snapshot.
