Firecracker.Drive (firecracker v0.1.0)
View SourceRepresents a disk drive configuration for a Firecracker virtual machine.
This module configures block devices that can be attached to a VM, including root filesystems and additional storage devices. Drives can be configured with various options for caching, rate limiting, and access modes.
Fields
:drive_id- Required. Unique identifier for the drive:is_root_device- Required. Whether this drive contains the root filesystem:path_on_host- Optional. Path to the drive file on the host filesystem:partuuid- Optional. Partition UUID to reference a specific drive partition:cache_type- Optional. Caching strategy (e.g., "unsafe", "writethrough"):is_read_only- Optional. Whether the drive should be mounted read-only:rate_limiter- Optional. I/O rate limiter configuration:io_engine- Optional. I/O engine to use (e.g., "sync", "async"):socket- Optional. UNIX socket path for vhost-user backed drives
Post-boot Behavior
Only :drive_id and :path_on_host can be modified after VM starts
Notes
- At least one drive must be configured as the root device
- Drive IDs must be unique within a VM configuration
- Rate limiters can throttle I/O operations and bandwidth
- For block devices, use
partuuidinstead ofpath_on_host
Summary
Types
@type t() :: %Firecracker.Drive{ applied?: boolean(), cache_type: String.t() | nil, drive_id: String.t(), io_engine: String.t() | nil, is_read_only: boolean() | nil, is_root_device: boolean(), partuuid: String.t() | nil, path_on_host: String.t() | nil, rate_limiter: Firecracker.RateLimiter.t() | nil, socket: String.t() | nil }