# How to clone a block storage volume

Source: https://docs.quake.ai/docs/block/how-to/clone-volume
Markdown: https://docs.quake.ai/docs/block/how-to/clone-volume.md

---

# How to clone a block storage volume

Create an independent copy of an existing volume. The clone is a new, fully writable volume. Changes to the clone do not affect the source, and vice versa. You can clone a source volume whether it is available or in use by a running instance: the operation does not require `--force` or a specific Cinder microversion.

<PrerequisiteBlock methods={["console", "cli", "api"]}>

- An existing block storage volume

</PrerequisiteBlock>

## Clone the volume

<MethodTabs>
<Method label="Console">

<NoMoreButton />

1. Go to **Storage** > **Volumes**.
2. Find the volume you want to clone. On its row, open the **Volume action** icon dropdown (middle of the three per-row icons) and select **Clone Volume**.
3. In the **Clone Volume** dialog, the `Volume` field is read-only and pre-filled with the source UUID, type, and size. Enter a `Volume Name` for the clone.
4. Set `Capacity (GiB)`. The field is pre-filled with the source size and must be equal to or larger than the source.
5. Select **OK**. An info banner notes that cloning is best performed on a quiesced volume (no active reads or writes).

</Method>
<Method label="CLI">

```bash
openstack volume create \
  --source SOURCE_VOLUME_ID \
  CLONE_VOLUME_NAME
```

`--size` is optional. When you omit it, the clone inherits the source volume size. To provision a larger clone, add `--size` with a value greater than the source size.



The CLI does not reject a `--size` smaller than the source volume. It silently rounds the request up to the source size and creates the clone at the source size, with no warning or error. The volumes API rejects an undersized `size` with `HTTP 400`. To create a larger clone, set `--size` to a value greater than the source size; to match the source size, omit `--size`.



</Method>
<Method label="API">

<BlockApiEnvPrereqs />

```bash
curl -X POST "$OS_VOLUME_URL/volumes" \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "volume": {
      "name": "CLONE_VOLUME_NAME",
      "source_volid": "SOURCE_VOLUME_ID"
    }
  }'
```

`size` is optional. When you omit it, the clone inherits the source volume size. To provision a larger clone, add a `size` greater than the source size. Unlike the CLI, the volumes API rejects a `size` smaller than the source with `HTTP 400`.

</Method>
</MethodTabs>

## Verify the clone

<MethodTabs>
<Method label="Console">

Go to **Storage** > **Volumes**. The cloned volume appears with status **Available** when ready.

</Method>
<Method label="CLI">

```bash
openstack volume show CLONE_VOLUME_NAME -c status -c size
```

</Method>
<Method label="API">

```bash
curl -s "$OS_VOLUME_URL/volumes/VOLUME_ID" \
  -H "X-Auth-Token: $OS_TOKEN" | python3 -m json.tool
```

</Method>
</MethodTabs>

## See also

- [Create a volume](/docs/block/how-to/create-volume)
- [Create a volume snapshot](/docs/block/how-to/create-snapshot)
- [Volumes concepts](/docs/block/concepts/volumes)
