Clone a bootable block storage volume via snapshot and deploy a VX1 instance.
Cloning a Bootable Block Storage volume creates an independent copy from a Block Storage Snapshot. Each clone is a standalone high_perf Block Storage volume, marked bootable, and usable as the boot device for a new VX1™ instance. This removes the need to manually replicate a boot environment across multiple deployments.
Follow this guide to snapshot an existing Bootable Block Storage volume, create a cloned Bootable Block Storage volume from that snapshot, and provision a VX1™ instance using the clone.
high_perf NVMe block storage.
A Block Storage Snapshot of the source Block Storage volume serves as the image for cloning. Create a Block Storage Snapshot of the Bootable Block Storage volume you want to clone, then confirm the snapshot is ready before proceeding.
Send a GET request to the List Block Storage Snapshots endpoint and note the id of the snapshot. Confirm that state shows COMPLETE before proceeding.
$ curl "https://api.vultr.com/v2/blocks/snapshots" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST request to the Create Block Storage endpoint to create a cloned Bootable Block Storage volume. Each clone is a new high_perf Block Storage volume created from the snapshot. The size must be equal to or greater than the snapshot size. Replace REGION with the region ID (for example, ewr), SIZE-GB with the volume size in GB, CLONE-LABEL with a label, and SNAPSHOT-ID with the snapshot ID.
$ curl "https://api.vultr.com/v2/blocks" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"region": "REGION",
"size_gb": SIZE-GB,
"label": "CLONE-LABEL",
"block_type": "high_perf",
"snapshot_id": "SNAPSHOT-ID",
"bootable": true
}'
Note the id from the response. The os_id for a Block Storage volume cloned from a Block Storage Snapshot is always 164 — this is the Snapshot OS type that Vultr assigns to snapshot-cloned Block Storage volumes. You must pass "os_id": 164 when provisioning the instance, as the API requires the instance OS identifier to exactly match the Block Storage volume's OS identifier.
Send a GET request to the Get Block Storage endpoint to confirm the clone status. Replace BLOCK-ID with the ID from the previous step.
$ curl "https://api.vultr.com/v2/blocks/{block-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that status is active and block_type is high_perf before provisioning an instance.
Send a POST request to the Create Instance endpoint to provision a VX1™ instance. For more information on VX1™ provisioning, see Provisioning VX1™ Cloud Compute Instances. Replace REGION with the same region as the clone, VX1-PLAN with the VX1™ plan ID (for example, vx1-g-2c-8g), INSTANCE-LABEL with a label, INSTANCE-HOSTNAME with a hostname, and BLOCK-ID with the clone ID.
$ curl "https://api.vultr.com/v2/instances" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"region": "REGION",
"plan": "VX1-PLAN",
"label": "INSTANCE-LABEL",
"hostname": "INSTANCE-HOSTNAME",
"os_id": 164,
"block_devices": [
{
"block_id": "BLOCK-ID",
"bootable": true
}
]
}'
Send a GET request to the Get Instance endpoint to confirm the instance status. Replace INSTANCE-ID with the ID from the previous step.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that status shows active and power_status shows running.
Block Storage Snapshot operations are not currently supported by the Vultr Terraform provider. Create a Block Storage Snapshot using the Vultr API, then note the snapshot ID before continuing.
Define a vultr_block_storage resource using the snapshot ID. Replace REGION, SIZE-GB, CLONE-LABEL, and SNAPSHOT-ID with your values. The size_gb must be equal to or greater than the snapshot size.
resource "vultr_block_storage" "clone" {
region = "REGION"
size_gb = SIZE-GB
label = "CLONE-LABEL"
block_type = "high_perf"
snapshot_id = "SNAPSHOT-ID"
bootable = true
}
After applying, retrieve the cloned Block Storage volume ID and os_id from the Terraform state:
$ terraform state show vultr_block_storage.clone
Note the id before provisioning the VX1™ instance.
Provision a VX1™ instance using the cloned Block Storage volume as the boot device. See Provisioning VX1™ Cloud Compute Instances for instructions. Use os_id 164 and vultr_block_storage.clone.id as the boot device Block Storage volume ID.