Snapshot a bootable Vultr Block Storage volume, clone it as high_perf, and boot a VX1 instance via API or Terraform.
Cloning a Bootable Block Storage volume creates an independent copy of the volume. Each clone is a standalone high_perf Block Storage volume that you can use as the boot device for a new VX1™ instance. Cloning removes the need to manually replicate a boot environment across multiple deployments.
Follow this guide to clone a Bootable Block Storage volume and provision a VX1™ instance from the clone using the Vultr API or Terraform.
Bootable Block Storage volume cloning is available in regions that support high_perf NVMe Block Storage.
The direct clone endpoint creates cloned volumes from an existing Bootable Block Storage volume (block_id) in a destination region. The destination region can differ from the source region, and the platform transfers the source image to the destination automatically as part of the clone operation.
Send a POST request to the Clone Block Storage endpoint to clone a Bootable Block Storage volume. Replace BLOCK_ID with the source volume ID, REGION with the destination region ID, such as ewr, COUNT with the number of clones, CLONE_LABEL with a label, and SIZE_GB with the volume size in GB.
The request accepts the following parameters:
block_id: The ID of the source Bootable Block Storage volume.region: The destination region for the cloned volumes. The value can differ from the source region.count: The number of clones to create in the request, from 1 to 64. Each clone is an independent volume.label: A label applied to every cloned volume in the request.size_gb: The volume size in GB. The value must be equal to or greater than the source size, and defaults to the source size.keep_snapshot: Optional. Set to true to retain the intermediate snapshot as a Block Storage Snapshot so you can reuse the source image for future clones. The default is false. A successful request returns an HTTP 200 OK response that contains a clone job id in the PENDING state. Note the id for the next step. The clone job runs asynchronously: the platform snapshots the source, creates the cloned volumes, and adds the new volumes to your account when the job completes.
Send a GET request to the Get Clone Block Storage Status endpoint to retrieve the clone job status. Replace {clone-id} with the clone job ID from the previous step.
The response contains the job state, timestamps, and a blocks list of the created volumes. While the job runs, state shows values such as PENDING and CREATING_SNAPSHOT. Repeat the request until state shows COMPLETE, then note the id of each volume in the blocks list. If the job fails, state shows FAILED and the blocks list still shows any partially created volumes so you can identify and remove them.
The clone job creates a Block Storage Snapshot of the source volume. Delete the snapshot when you no longer need it, because you cannot delete a Block Storage volume that has existing snapshots.
Send a POST request to the Create Instance endpoint to provision a VX1™ instance from a cloned volume. A cloned volume always uses os_id 164, which is the Snapshot OS type, and the instance OS identifier must match this value. For more information, see Provisioning VX1™ Cloud Compute Instances. Replace REGION with the same region as the clone, VX1_PLAN with the VX1™ plan ID, such as vx1-g-2c-8g, INSTANCE_LABEL with a label, INSTANCE_HOSTNAME with a hostname, and BLOCK_ID with a cloned volume ID from the previous step.
A successful request returns an HTTP 202 Accepted response. Note the instance id.
Send a GET request to the Get Instance endpoint to retrieve the instance details. Replace {instance-id} with the ID from the previous step.
Verify that status shows active and power_status shows running.
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 before you begin.
Send a GET request to the List Block Storage Snapshots endpoint to list your Block Storage Snapshots.
Verify that the snapshot state shows COMPLETE, and note the snapshot id.
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, and the size must be equal to or greater than the snapshot size. Replace REGION with the region ID, such as ewr, SIZE_GB with the volume size in GB, CLONE_LABEL with a label, and SNAPSHOT_ID with the snapshot ID.
A successful request returns an HTTP 202 Accepted response. Note the id from the response. The os_id for a Block Storage volume cloned from a Block Storage Snapshot is always 164, which is the Snapshot OS type that Vultr assigns to snapshot-cloned volumes. Pass "os_id": 164 when you provision the instance, because the API requires the instance OS identifier to match the Block Storage volume's OS identifier.
Send a GET request to the Get Block Storage endpoint to retrieve the clone details. Replace {block-id} with the ID from the previous step.
Verify that status shows active and block_type shows high_perf before you provision an instance.
Send a POST request to the Create Instance endpoint to provision a VX1™ instance. For more information, see Provisioning VX1™ Cloud Compute Instances. Replace REGION with the same region as the clone, VX1_PLAN with the VX1™ plan ID, such as vx1-g-2c-8g, INSTANCE_LABEL with a label, INSTANCE_HOSTNAME with a hostname, and BLOCK_ID with the clone ID.
A successful request returns an HTTP 202 Accepted response. Note the instance id.
Send a GET request to the Get Instance endpoint to retrieve the instance details. Replace {instance-id} with the ID from the previous step.
Verify that status shows active and power_status shows running.
0 Comments
Be the first to comment and share your perspective with the community.