# Restore a volume snapshot

Create a new volume from a completed volume snapshot, in the snapshot's zone.

A restore always creates a new volume; it never writes into an existing one. Replace the ids with
your own.

**Important:**
The new volume is billed for its size from creation until you delete it.

## Prerequisites

- Permission for `ec2:CreateVolume`, and `ec2:DescribeSnapshots` on the snapshot (else `404`
  "Snapshot not found").
- In the console, also `ec2:DescribeVolumes` to see the new volume on **Volumes**, which opens after
  the restore (without it the page says "Access denied").
- The snapshot is `completed`, else `409` "Snapshot … is …" with its state. In the console,
  **Restore to new volume** is unavailable until then.
- Room in the volumes and volume storage quotas.
- Any tags your organization requires, else `400` "Missing required tags: …".

## Restore

**Console**
1. Open **Compute**, then **Volume snapshots**, and choose the snapshot in the list.
2. Choose **Restore to new volume**.
3. For **Name**, keep the suggested name (the snapshot's name, or its volume's id, followed by
   `-restored`) or enter another.
4. For **Size (GiB)**, keep the snapshot's size or enter more.
5. Choose **Restore**. **Volumes** opens.

**CLI**
```sh
dcloud ec2 volumes create --name data-restored --size-gib 50 --region-id de1 \
  --snapshot-id snap-5e6f7a8b
```

**API**
```http
POST /ec2/api/volumes
{ "name": "data-restored", "sizeGib": 50, "regionId": "de1", "snapshotId": "snap-5e6f7a8b" }
```

**Terraform**
```hcl
resource "dcloud_volume" "restored" {
  name        = "data-restored"
  size_gib    = 50
  snapshot_id = "snap-5e6f7a8b"
}
```

The volume is created in the snapshot's zone when you name none; another zone is refused with `409`
"Snapshot … is in …; a volume restored from it is created in the same zone." In Terraform, set
`availability_zone_id` to the snapshot's zone when it is not `de1a`. A size below the snapshot's is
refused with `400` "The volume must be at least … GiB, the snapshot's size".
`kmsKeyId` does not apply (`400`): a volume restored from an encrypted snapshot is encrypted with
the snapshot's key and opens like the original; one restored from an unencrypted snapshot is not
encrypted.

## Result

The volume stays `creating` (**Restoring n %** in the console) until every piece is written and
checked against its hash, then turns `available`; nothing formats it. If the restore fails, the
volume turns `error`. Measured on 2026-11-12: restoring a snapshot of a 50 GiB volume holding
6.6 GiB into a new 50 GiB volume took 73 seconds. A bigger volume keeps the filesystem's size: grow
it on the instance (`resize2fs`; for an encrypted volume, see [Grow or rename a volume](grow-a-volume.md)).

## Related

- [Snapshot a volume](snapshot-a-volume.md)
- `ec2.volumes.create` · `dcloud ec2 volumes create` · `dcloud_volume`
