Ephemeral drives are physically attached to the compute host. Because they are local and not network-attached, they offer low latency and high throughput, making them ideal for workloads that require maximum performance. However, the storage is ephemeral, data is lost if the guest is stopped, so ephemeral drives are best suited for temporary data or caches rather than persistent storage.
Ephemeral drives are managed through the :doc:`drives` API calls, which allow you to create, attach, detach, and delete these drives as needed.
| Action | Allowed |
|---|---|
| Create | Yes |
| Delete | Yes |
| Update | Yes |
| Attach | Yes |
| Resize | Yes |
| Clone | No |
| Download | No |
| Upload | No |
| Create Snapshot | No |
| Create Remote Snapshot | No |
.. http:post:: /drives/{uuid}/action/?do=resize
Note that the resize action is a full definition update (it can update even name and metadata), so a full definition should be provided to this call.
- Resize is permitted only when the drive is in an active state
(
MOUNTEDorUNMOUNTED) or in aSTAGINGstate. - The new size must be within the minimum and maximum limits specified by the :doc:`capabilities` API call.
- The system verifies that the resized ephemeral drive can fit within the existing available space in the cloud.
Example:
.. literalinclude:: dumps/request_ephemeral_drive_resize_action
:language: http
Note that the drive in the response is with status resizing:
.. literalinclude:: dumps/response_drive_resize_action
:language: javascript
Ephemeral drives are billed only when they are attached to running guests. See the following example.
The following values show the total Local NVMe capacity allocated to the customer’s account and the amount included in their subscriptions. The allocated capacity represents the maximum Local NVMe space reserved for use, while the subscription amount indicates the portion covered at no additional cost.
- Local NVMe Allocated: 352 GB — The total Local NVMe storage capacity assigned to the account.
- Local NVMe Subscription: 1 GB — The amount of Local NVMe usage included in the subscription without extra charges.
In this example, with 2 GB in use and 1 GB included in the subscription, the customer is billed for 1 GB of Local NVMe usage.
Although 352 GB of Local NVMe is allocated, the billing system counts only the 2 GB actively in use. Since the subscription includes 1 GB, charges apply only to the additional 1 GB of usage beyond the subscription limit.
Setup a guest with an OS drive(NVMe) and an ephemeral drive(Local NVMe).
To mount the vdb device, you’ll need to format it (if it hasn’t been formatted yet), create a mount
point, and then mount it.
Before formatting, identify the correct device name for your ephemeral drive. You can list available block devices using:
lsblkLook for a device that matches the expected size of your ephemeral drive
and is not yet mounted. In many cases, the device will appear as /dev/vdb,
but this may vary.
For example, to format vdb with the ext4 filesystem:
sudo mkfs.ext4 /dev/vdbChoose a directory where you want to mount the disk. Commonly, additional storage is mounted
under /mnt or /media.
sudo mkdir -p /mnt/ephemeralMount vdb to the directory you created:
sudo mount /dev/vdb /mnt/ephemeralUse the lsblk or df -h command to confirm that vdb is mounted:
lsblk
df -hTo verify write access, create a small test file in the mounted directory:
sudo touch /mnt/ephemeral/testfileList the directory to confirm the file was created:
ls -l /mnt/ephemeralOnce verified, you can remove the test file:
sudo rm /mnt/ephemeral/testfile
