# snapshot-restore

Restore a flexi image snapshot to a VM or storage instance. This command allows you to revert a VM or storage instance to the state captured in a flexi image snapshot.

## Usage

```
cldkctl flexi-image snapshot-restore [flags]
```

## Aliases

```
snapshot-restore, snapshot-restore
```

## Steps

Follow the steps below to run and view the result of this command:

1. Refer to the [**Image List**](https://docs.cloudeka.ai/cloudeka-api-list/command-reference/cldkctl-flexi-image/list) section to obtain the **image ID**.
2. Refer to the [**Image Detail**](https://docs.cloudeka.ai/cloudeka-api-list/command-reference/cldkctl-flexi-image/detail) section to obtain the **instance ID**.
3. Run the following command in your terminal:

```
cldkctl flexi-image snapshot-restore --image [image-id] --instance [instance-id] 
```

4. Replace **\[image-id]** with the image ID and **\[instance-id]** with the instance ID.
5. When prompted, type **y** to confirm the snapshot restore.
6. Once completed successfully, the terminal displays the success message.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2F64IIZSg1lGHIywt6qu72%2Fimage%20(1).png?alt=media&#x26;token=1f06b083-0ca1-49a0-a35e-ec2a585597e6" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](https://docs.cloudeka.ai/cloudeka-api-list/global-flags). Refer to the Global Flags section for details
{% endhint %}

<table><thead><tr><th width="223.77777099609375">Flag</th><th>Description</th></tr></thead><tbody><tr><td>-h, --help<br>--image string<br>--instance string</td><td>Help for the snapshot-restore command.<br>Image ID of the snapshot to restore.<br>Instance ID of the VM or storage to restore.</td></tr></tbody></table>
